/*
 * Community / study-room reference pass
 *
 * This file is intentionally scoped to .community-modern so it can be loaded
 * after the legacy styles without changing markup, state, or access rules.
 */

.community-modern {
  --community-ref-brand: #087454;
  --community-ref-brand-strong: #056247;
  --community-ref-brand-soft: #edf7f3;
  --community-ref-ink: #18211d;
  --community-ref-muted: #6b756f;
  --community-ref-line: #e2e8e4;
  --community-ref-line-strong: #cfdad4;
  --community-ref-surface: #ffffff;
  --community-ref-subtle: #f7f9f8;
  width: min(1120px, 100%);
  gap: 18px;
  color: var(--community-ref-ink);
}

.community-modern > .workspace-head {
  min-height: 0;
  align-items: end;
  border: 0;
  background: transparent;
  padding: 2px 0 4px;
  box-shadow: none;
}

.community-modern > .workspace-head::before,
.community-modern > .workspace-head::after {
  content: none;
}

.community-modern .workspace-title-block {
  gap: 3px;
}

.community-modern .workspace-title-block .workspace-kicker {
  display: none;
}

.community-modern .workspace-title-block h2 {
  margin: 0;
  color: var(--community-ref-ink);
  font-size: 26px;
  font-weight: 750;
  line-height: 1.25;
}

.community-modern .workspace-title-block > p {
  margin: 0;
  color: var(--community-ref-muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.community-modern .community-shell {
  display: grid;
  grid-template-columns: minmax(300px, 342px) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.community-modern .community-left-rail {
  position: sticky;
  top: 84px;
  min-width: 0;
  overflow: visible;
}

.community-modern .community-control-panel {
  display: grid;
  gap: 12px;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.community-modern .community-control-head {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.community-modern .community-control-head > div {
  display: grid;
  gap: 1px;
}

.community-modern .community-control-head .workspace-kicker,
.community-modern .community-control-head p {
  display: none;
}

.community-modern .community-control-head h3 {
  margin: 0;
  color: var(--community-ref-ink);
  font-size: 17px;
  font-weight: 730;
  line-height: 1.35;
}

.community-modern .community-create-trigger {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: var(--community-ref-brand);
  padding: 0;
  color: #fff;
  box-shadow: none;
}

.community-modern .community-create-trigger:hover {
  background: var(--community-ref-brand-strong);
  transform: none;
}

.community-modern .community-create-trigger > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.community-modern .community-create-trigger .icon {
  width: 19px;
  height: 19px;
}

.community-modern .community-mobile-picker {
  display: none !important;
}

.community-modern .community-board-browser,
.community-modern .community-board-browser.is-open,
.community-modern .community-board-browser:not(.is-open) {
  display: grid !important;
  gap: 10px;
  min-width: 0;
  margin: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.community-modern .community-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "search access"
    "tabs tabs"
    "count count";
  gap: 8px;
  align-items: center;
}

.community-modern .community-search-row > .searchbox {
  grid-area: search;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--community-ref-line);
  border-radius: 10px;
  background: var(--community-ref-surface);
  padding: 0 12px;
  box-shadow: none;
}

.community-modern .community-search-row > .searchbox:focus-within {
  border-color: var(--community-ref-brand);
  box-shadow: 0 0 0 3px rgba(8, 116, 84, 0.1);
}

.community-modern .community-search-row > .searchbox .icon {
  width: 18px;
  height: 18px;
  color: var(--community-ref-muted);
}

.community-modern .community-search-row > .searchbox input {
  min-width: 0;
  color: var(--community-ref-ink);
  font-size: 14px;
  font-weight: 500;
}

.community-modern .community-search-row > .searchbox input::placeholder {
  color: #98a19c;
  opacity: 1;
}

.community-modern .community-search-row > .compact-tabs {
  grid-area: tabs;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  min-width: 0;
  overflow: visible;
  border-bottom: 1px solid var(--community-ref-line);
  padding: 0;
}

.community-modern .community-search-row > .compact-tabs .chip {
  min-width: 0;
  min-height: 39px;
  justify-content: center;
  gap: 5px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  padding: 0 6px;
  color: var(--community-ref-muted);
  font-size: 12px;
  font-weight: 650;
  box-shadow: none;
}

.community-modern .community-search-row > .compact-tabs .chip:hover {
  background: var(--community-ref-subtle);
  color: var(--community-ref-ink);
  transform: none;
}

.community-modern .community-search-row > .compact-tabs .chip.active {
  border-bottom-color: var(--community-ref-brand);
  background: transparent;
  color: var(--community-ref-brand);
}

.community-modern .community-search-row > .compact-tabs .icon {
  width: 15px;
  height: 15px;
}

.community-modern .community-access-filter {
  grid-area: access;
  position: relative;
  min-width: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
}

.community-modern .community-access-filter > summary {
  display: grid;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--community-ref-line);
  border-radius: 10px;
  background: var(--community-ref-surface);
  padding: 0;
  color: transparent;
  font-size: 0;
  list-style: none;
}

.community-modern .community-access-filter > summary::-webkit-details-marker {
  display: none;
}

.community-modern .community-access-filter > summary .icon {
  width: 18px;
  height: 18px;
  color: var(--community-ref-muted);
}

.community-modern .community-access-filter[open] > summary {
  border-color: var(--community-ref-brand);
  color: transparent;
  box-shadow: 0 0 0 3px rgba(8, 116, 84, 0.1);
}

.community-modern .community-access-filter > div {
  position: absolute;
  z-index: 12;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  width: 154px;
  grid-template-columns: 1fr;
  gap: 4px;
  border: 1px solid var(--community-ref-line);
  border-radius: 10px;
  background: var(--community-ref-surface);
  padding: 6px;
  box-shadow: 0 12px 30px rgba(24, 33, 29, 0.12);
}

.community-modern .community-access-filter .chip {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  justify-content: flex-start;
  border: 0;
  border-radius: 7px;
  background: transparent;
  padding: 0 9px;
  color: var(--community-ref-ink);
  font-size: 12px;
  box-shadow: none;
}

.community-modern .community-access-filter .chip.active {
  background: var(--community-ref-brand-soft);
  color: var(--community-ref-brand);
}

.community-modern #communityBoardCount {
  grid-area: count;
  justify-self: end;
  margin: -2px 2px 0;
  color: var(--community-ref-muted);
  font-size: 11px;
  font-weight: 500;
}

.community-modern .enhanced-board-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  max-height: calc(100dvh - 310px);
  overflow-x: hidden;
  overflow-y: auto;
  border-top: 1px solid var(--community-ref-line);
  border-bottom: 1px solid var(--community-ref-line);
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: #c8d2cc transparent;
}

.community-modern .enhanced-board-list .community-board {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 78px;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--community-ref-line);
  border-radius: 0;
  background: var(--community-ref-surface);
  padding: 10px 7px;
  color: var(--community-ref-ink);
  text-align: left;
  box-shadow: none;
  transform: none;
}

.community-modern .enhanced-board-list .community-board:last-child {
  border-bottom: 0;
}

.community-modern .enhanced-board-list .community-board:hover {
  border-color: var(--community-ref-line);
  border-bottom-color: var(--community-ref-line);
  background: var(--community-ref-subtle);
  box-shadow: none;
  transform: none;
}

.community-modern .enhanced-board-list .community-board.active {
  border-color: var(--community-ref-line);
  border-bottom-color: var(--community-ref-line);
  background: var(--community-ref-brand-soft);
  color: var(--community-ref-ink);
  box-shadow: none;
}

.community-modern .enhanced-board-list .community-board.active :is(strong, .board-name) {
  color: var(--community-ref-brand-strong);
}

.community-modern .enhanced-board-list .board-type-icon {
  display: grid;
  width: 50px;
  min-width: 50px;
  height: 50px;
  place-items: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--board-color, var(--community-ref-brand)) 18%, #dfe7e3);
  border-radius: 10px;
  background: color-mix(in srgb, var(--board-color, var(--community-ref-brand)) 12%, #fff);
  color: var(--board-color, var(--community-ref-brand));
  box-shadow: none;
}

.community-modern .enhanced-board-list .board-type-icon .icon {
  width: 23px;
  height: 23px;
}

.community-modern .enhanced-board-list .board-main {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.community-modern .enhanced-board-list .board-main strong {
  min-width: 0;
  overflow: hidden;
  color: var(--community-ref-ink);
  font-size: 14px;
  font-weight: 720;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-modern .enhanced-board-list .board-main small {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  color: var(--community-ref-muted);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.community-modern .enhanced-board-list .board-stat {
  display: grid;
  min-width: 43px;
  justify-items: end;
  gap: 1px;
  padding: 0;
}

.community-modern .enhanced-board-list .board-stat b {
  color: var(--community-ref-ink);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.25;
}

.community-modern .enhanced-board-list .board-stat small {
  max-width: 52px;
  overflow: hidden;
  color: var(--community-ref-muted);
  font-size: 10px;
  font-weight: 550;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-modern .enhanced-board-list .board-pending {
  top: 5px;
  right: 5px;
  min-width: 18px;
  height: 18px;
  border-width: 2px;
  font-size: 9px;
}

/* Selected room: hierarchy comes from type and spacing rather than nested cards. */
.community-modern .community-main-panel {
  display: grid;
  min-width: 0;
  gap: 14px;
}

.community-modern .community-hero {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  min-height: 0;
  align-items: center;
  gap: 14px;
  overflow: visible;
  border: 0;
  border-bottom: 1px solid var(--community-ref-line);
  border-radius: 0;
  background: transparent;
  padding: 4px 0 16px;
  box-shadow: none;
}

.community-modern .community-hero.no-banner {
  grid-template-columns: 64px minmax(0, 1fr) auto;
}

.community-modern .community-hero.no-banner::before {
  content: "";
  display: block;
  width: 64px;
  height: 64px;
  border: 1px solid color-mix(in srgb, var(--community-color, var(--community-ref-brand)) 18%, #dfe7e3);
  border-radius: 11px;
  background-color: color-mix(in srgb, var(--community-color, var(--community-ref-brand)) 10%, #fff);
  background-image: url("/wooshin-high-icon.svg?v=2");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 36px 36px;
}

.community-modern .community-banner {
  width: 76px;
  min-width: 76px;
  height: 76px;
  max-height: none;
  aspect-ratio: 1;
  border: 1px solid var(--community-ref-line);
  border-radius: 11px;
  object-fit: cover;
  box-shadow: none;
}

.community-modern .community-hero-text {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.community-modern .community-hero-context {
  gap: 7px;
  color: var(--community-ref-brand);
  font-size: 10.5px;
  font-weight: 650;
}

.community-modern .community-hero-context span + span::before {
  color: #b3bcb7;
}

.community-modern .community-hero-text h2 {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--community-ref-ink);
  font-size: 22px;
  font-weight: 760;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-modern .community-hero-text > p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--community-ref-muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.community-modern .community-hero .meta {
  display: flex;
  gap: 8px;
  margin-top: 2px;
  color: var(--community-ref-muted);
  font-size: 11px;
  font-weight: 550;
}

.community-modern .community-hero-actions {
  position: static;
  display: flex;
  max-width: 210px;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.community-modern .community-hero-actions > :is(button, a) {
  min-height: 38px;
  border-radius: 9px;
  padding-inline: 12px;
  box-shadow: none;
}

.community-modern .community-section-tabs {
  display: flex;
  width: 100%;
  max-width: none;
  justify-content: flex-start;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border: 0;
  border-bottom: 1px solid var(--community-ref-line);
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  scrollbar-width: none;
}

.community-modern .community-section-tabs::-webkit-scrollbar {
  display: none;
}

.community-modern .community-section-tabs > button {
  flex: 0 0 auto;
  min-width: 92px;
  min-height: 42px;
  gap: 5px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  padding: 0 12px;
  color: var(--community-ref-muted);
  font-size: 12px;
  font-weight: 650;
  box-shadow: none;
}

.community-modern .community-section-tabs > button.active {
  border-bottom-color: var(--community-ref-brand);
  background: transparent;
  color: var(--community-ref-brand);
}

.community-modern .community-section-tabs > button b:not(:empty) {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--community-ref-subtle);
  padding: 0 5px;
  color: var(--community-ref-muted);
  font-size: 9px;
}

.community-modern .community-section-tabs > button.active b:not(:empty) {
  background: var(--community-ref-brand-soft);
  color: var(--community-ref-brand);
}

.community-modern .feed-tab-panel {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.community-modern .feed-tab-panel .feed-tab-row {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 0;
  scrollbar-width: none;
}

.community-modern .feed-tab-panel .chip {
  min-width: 0;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  padding: 0 9px;
  color: var(--community-ref-muted);
  font-size: 11px;
  box-shadow: none;
}

.community-modern .feed-tab-panel .chip.active {
  border-color: var(--community-ref-line-strong);
  background: var(--community-ref-subtle);
  color: var(--community-ref-ink);
}

.community-modern .community-feed {
  gap: 0;
  border-top: 1px solid var(--community-ref-line);
  border-radius: 0;
  background: transparent;
}

.community-modern .community-feed > .community-post-card {
  border: 0;
  border-bottom: 1px solid var(--community-ref-line);
  border-radius: 0;
  background: var(--community-ref-surface);
  padding: 15px 2px;
  box-shadow: none;
}

.community-modern .community-main-panel > .community-study-room,
.community-modern .community-main-panel > .community-write,
.community-modern .community-main-panel > .community-customize {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.community-modern :is(.community-board, .community-section-tabs button, .community-create-trigger, .community-access-filter > summary):focus-visible {
  outline: 3px solid rgba(8, 116, 84, 0.22);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  .community-modern .community-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .community-modern .community-left-rail {
    position: static;
    top: auto;
  }

  .community-modern .enhanced-board-list {
    max-height: 330px;
  }
}

@media (max-width: 700px) {
  .community-modern {
    width: 100%;
    gap: 12px;
  }

  .community-modern > .workspace-head {
    display: block;
    padding: 0 0 2px;
  }

  .community-modern .workspace-title-block h2 {
    font-size: 22px;
  }

  .community-modern .workspace-title-block > p,
  .community-modern > .workspace-head .workspace-head-actions {
    display: none;
  }

  .community-modern .community-control-panel {
    position: relative;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 42px !important;
    gap: 0 !important;
    padding: 0 !important;
  }

  .community-modern .community-control-head {
    display: contents !important;
  }

  .community-modern .community-control-head > div,
  .community-modern .community-control-head > .badge,
  .community-modern .community-mobile-picker {
    display: none !important;
  }

  .community-modern .community-create-trigger {
    position: absolute;
    z-index: 3;
    top: 0;
    right: 0;
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    grid-column: 2 !important;
    grid-row: 1 !important;
  }

  .community-modern .community-board-browser,
  .community-modern .community-board-browser.is-open,
  .community-modern .community-board-browser:not(.is-open),
  .community-modern .community-control-head > .badge + .community-mobile-picker + .community-board-browser {
    display: grid !important;
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    gap: 9px;
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;
  }

  .community-modern .community-search-row {
    grid-template-columns: minmax(0, 1fr) 42px;
    grid-template-areas:
      "search create-space"
      "tabs tabs"
      "count access";
    gap: 7px;
  }

  .community-modern .community-search-row > .searchbox {
    min-height: 42px;
  }

  .community-modern .community-search-row > .compact-tabs {
    min-width: 0;
  }

  .community-modern .community-search-row > .compact-tabs .chip {
    min-height: 38px;
    gap: 4px;
    padding-inline: 3px;
    font-size: 11px;
  }

  .community-modern .community-search-row > .compact-tabs .icon {
    width: 14px;
    height: 14px;
  }

  .community-modern .community-access-filter {
    grid-area: access;
    justify-self: end;
  }

  .community-modern .community-access-filter > summary {
    width: auto;
    min-width: 0;
    height: 30px;
    min-height: 30px;
    display: inline-flex;
    gap: 5px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    padding: 0 2px 0 8px;
    color: var(--community-ref-muted);
    font-size: 10.5px;
    font-weight: 600;
  }

  .community-modern .community-access-filter > summary .icon {
    width: 14px;
    height: 14px;
  }

  .community-modern .community-access-filter > div {
    top: calc(100% + 2px);
  }

  .community-modern #communityBoardCount {
    grid-area: count;
    align-self: center;
    justify-self: start;
    margin: 0 2px;
  }

  .community-modern .enhanced-board-list {
    max-height: 310px;
    border-top-color: var(--community-ref-line);
  }

  .community-modern .enhanced-board-list .community-board {
    min-height: 72px;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 9px 4px;
  }

  .community-modern .enhanced-board-list .board-type-icon {
    width: 46px;
    min-width: 46px;
    height: 46px;
    border-radius: 9px;
  }

  .community-modern .enhanced-board-list .board-type-icon .icon {
    width: 21px;
    height: 21px;
  }

  .community-modern .enhanced-board-list .board-main strong {
    font-size: 13.5px;
  }

  .community-modern .enhanced-board-list .board-main small {
    font-size: 11px;
    -webkit-line-clamp: 1;
  }

  .community-modern .community-main-panel {
    gap: 12px;
  }

  .community-modern .community-hero,
  .community-modern .community-hero.no-banner {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 10px;
    padding: 4px 0 13px;
  }

  .community-modern .community-hero.no-banner::before {
    width: 56px;
    height: 56px;
    border-radius: 9px;
    background-size: 32px 32px;
  }

  .community-modern .community-banner {
    width: 56px;
    min-width: 56px;
    height: 56px;
    border-radius: 9px;
  }

  .community-modern .community-hero-text h2 {
    font-size: 19px;
  }

  .community-modern .community-hero-context {
    overflow: hidden;
    font-size: 9.5px;
    white-space: nowrap;
  }

  .community-modern .community-hero-text > p {
    font-size: 12px;
    -webkit-line-clamp: 1;
  }

  .community-modern .community-hero .meta {
    gap: 6px;
    overflow-x: auto;
    font-size: 10px;
    white-space: nowrap;
    scrollbar-width: none;
  }

  .community-modern .community-hero-actions {
    grid-column: 1 / -1;
    width: 100%;
    max-width: none;
    justify-content: stretch;
  }

  .community-modern .community-hero-actions > :is(button, a) {
    width: 100%;
  }

  .community-modern .community-section-tabs > button {
    min-width: 82px;
    min-height: 40px;
    padding-inline: 9px;
  }

  .community-modern .feed-tab-panel {
    align-items: center;
  }

  .community-modern .feed-tab-panel > .muted {
    display: none;
  }

  .community-modern .feed-tab-panel .feed-tab-row {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
    overflow: visible;
  }

  .community-modern .feed-tab-panel .chip {
    width: 100%;
    justify-content: center;
    padding-inline: 3px;
  }

  .community-modern .community-feed > .community-post-card {
    padding: 13px 0;
  }
}

@media (max-width: 350px) {
  .community-modern .community-search-row > .compact-tabs .chip .icon,
  .community-modern .community-section-tabs > button .icon {
    display: none;
  }

  .community-modern .enhanced-board-list .community-board {
    grid-template-columns: 42px minmax(0, 1fr) auto;
  }

  .community-modern .enhanced-board-list .board-type-icon {
    width: 42px;
    min-width: 42px;
    height: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .community-modern *,
  .community-modern *::before,
  .community-modern *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Focus room: timer, current totals, goal, and participants form one calm tool. */
.community-modern .community-study-room .study-room-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--community-ref-line);
  padding: 2px 0 13px;
}

.community-modern .community-study-room .study-room-head > div:first-child {
  display: grid;
  gap: 3px;
}

.community-modern .community-study-room .study-room-head .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--community-ref-brand);
  font-size: 10.5px;
  font-weight: 680;
}

.community-modern .community-study-room .study-room-head h3 {
  margin: 0;
  color: var(--community-ref-ink);
  font-size: 19px;
  font-weight: 740;
  line-height: 1.35;
}

.community-modern .community-study-room .study-room-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.community-modern .community-study-room .study-summary-pills {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--community-ref-line);
  border-radius: 9px;
  background: var(--community-ref-surface);
}

.community-modern .community-study-room .study-summary-pills > span {
  display: grid;
  min-width: 72px;
  gap: 1px;
  border: 0;
  border-right: 1px solid var(--community-ref-line);
  border-radius: 0;
  background: transparent;
  padding: 7px 9px;
  text-align: left;
}

.community-modern .community-study-room .study-summary-pills > span:last-child {
  border-right: 0;
}

.community-modern .community-study-room .study-summary-pills b {
  color: var(--community-ref-ink);
  font-size: 13px;
  font-weight: 730;
}

.community-modern .community-study-room .study-summary-pills small {
  color: var(--community-ref-muted);
  font-size: 9.5px;
  font-weight: 520;
}

.community-modern .community-study-room .invite-button {
  min-height: 38px;
  border: 1px solid var(--community-ref-line);
  border-radius: 9px;
  background: #fff;
  color: var(--community-ref-brand);
  box-shadow: none;
}

.community-modern .community-study-room .study-room-grid.visual-study-grid {
  grid-template-columns: minmax(260px, 0.88fr) minmax(320px, 1.12fr);
  gap: 18px;
  align-items: start;
}

.community-modern .community-study-room .study-side-stack {
  gap: 14px;
}

.community-modern .community-study-room .study-timer-card,
.community-modern .community-study-room .study-leaderboard {
  position: static;
  overflow: visible;
  border: 1px solid var(--community-ref-line);
  border-radius: 10px;
  background: var(--community-ref-surface);
  padding: 13px;
  box-shadow: none;
}

.community-modern .community-study-room .study-timer-card::after {
  content: none;
}

.community-modern .community-study-room .study-stopwatch-face {
  min-height: 112px;
  align-content: center;
  gap: 4px;
  border: 1px solid #a9cdbd;
  border-radius: 9px;
  background: #f1f8f5;
  padding: 15px;
  color: var(--community-ref-ink);
  box-shadow: none;
}

.community-modern .community-study-room .study-stopwatch-face span,
.community-modern .community-study-room .study-stopwatch-face small {
  color: var(--community-ref-muted);
  font-size: 10.5px;
  font-weight: 560;
}

.community-modern .community-study-room .study-stopwatch-face strong {
  color: var(--community-ref-ink);
  font-size: clamp(34px, 5vw, 46px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0;
  text-shadow: none;
}

.community-modern .community-study-room .study-start-form {
  gap: 10px;
}

.community-modern .community-study-room .study-start-copy {
  display: grid;
  gap: 2px;
  border: 0;
  border-bottom: 1px solid var(--community-ref-line);
  border-radius: 0;
  background: transparent;
  padding: 3px 0 10px;
}

.community-modern .community-study-room .study-start-copy strong {
  color: var(--community-ref-ink);
  font-size: 15px;
  font-weight: 720;
}

.community-modern .community-study-room .study-start-copy span {
  color: var(--community-ref-muted);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.45;
}

.community-modern .community-study-room .study-goal-select {
  display: grid;
  gap: 6px;
  color: var(--community-ref-muted);
  font-size: 11px;
  font-weight: 600;
}

.community-modern .community-study-room .study-goal-select .select {
  min-height: 42px;
  border-color: var(--community-ref-line);
  border-radius: 9px;
  background: #fff;
}

.community-modern .community-study-room .study-start-warning,
.community-modern .community-study-room .study-confirm-alert {
  gap: 4px;
  border: 1px solid #eadca6;
  border-radius: 9px;
  background: #fffdf3;
  padding: 10px;
  box-shadow: none;
}

.community-modern .community-study-room .study-start-warning strong,
.community-modern .community-study-room .study-confirm-alert strong {
  font-size: 11.5px;
}

.community-modern .community-study-room .study-start-warning p,
.community-modern .community-study-room .study-confirm-alert p {
  font-size: 10.5px;
  line-height: 1.45;
}

.community-modern .community-study-room .study-start-verify {
  align-items: flex-start;
  color: var(--community-ref-muted);
  font-size: 11px;
  font-weight: 550;
  line-height: 1.4;
}

.community-modern .community-study-room .study-start-main-button {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 9px;
  background: var(--community-ref-brand);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: none;
}

.community-modern .community-study-room .study-start-main-button:hover {
  background: var(--community-ref-brand-strong);
  transform: none;
}

.community-modern .community-study-room .study-tools-toggle {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-top: 1px solid var(--community-ref-line);
  border-radius: 0;
  background: transparent;
  padding: 7px 2px 0;
  color: var(--community-ref-muted);
  font-size: 11px;
  box-shadow: none;
}

.community-modern .community-study-room .study-leaderboard {
  gap: 0;
  padding: 0;
}

.community-modern .community-study-room .study-leaderboard .mini-title {
  min-height: 42px;
  align-items: center;
  border-bottom: 1px solid var(--community-ref-line);
  padding: 0 12px;
}

.community-modern .community-study-room .study-leaderboard .mini-title strong {
  font-size: 13px;
  font-weight: 720;
}

.community-modern .community-study-room .study-rank {
  min-height: 48px;
  grid-template-columns: 24px 30px minmax(0, 1fr) auto auto;
  gap: 7px;
  border: 0;
  border-bottom: 1px solid var(--community-ref-line);
  border-radius: 0;
  background: transparent;
  padding: 7px 11px;
  box-shadow: none;
  transform: none;
}

.community-modern .community-study-room .study-rank:last-child {
  border-bottom: 0;
}

.community-modern .community-study-room .study-rank:hover,
.community-modern .community-study-room .study-rank.me {
  border-color: var(--community-ref-line);
  background: var(--community-ref-brand-soft);
  box-shadow: none;
  transform: none;
}

.community-modern .community-study-room .rank-no {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--community-ref-subtle);
  color: var(--community-ref-muted);
  font-size: 10px;
  box-shadow: none;
}

.community-modern .community-study-room .study-rank strong,
.community-modern .community-study-room .study-rank b {
  font-size: 11.5px;
}

/* Keep the classroom feature, but remove the old 3D furniture treatment. */
.community-modern .community-study-room .study-classroom {
  min-height: 0;
  gap: 10px;
  overflow: visible;
  border: 1px solid var(--community-ref-line);
  border-radius: 10px;
  background: var(--community-ref-surface);
  padding: 12px;
  perspective: none;
  box-shadow: none;
}

.community-modern .community-study-room .study-classroom::before {
  content: none;
}

.community-modern .community-study-room .classroom-board {
  min-height: 58px;
  border: 0;
  border-radius: 8px;
  background: #164c3c;
  color: #fff;
  padding: 10px;
  font-size: 15px;
  box-shadow: none;
  transform: none;
}

.community-modern .community-study-room .classroom-floor {
  max-height: 460px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 4px 0 0;
  box-shadow: none;
}

.community-modern .community-study-room .seat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.community-modern .community-study-room .study-seat {
  min-height: 62px;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 3px 7px;
  border: 1px solid var(--community-ref-line);
  border-radius: 8px;
  background: var(--community-ref-subtle);
  color: var(--community-ref-ink);
  padding: 7px;
  box-shadow: none;
  transform: none;
}

.community-modern .community-study-room .study-seat::after {
  content: none;
}

.community-modern .community-study-room .study-seat small {
  color: var(--community-ref-muted);
}

.community-modern .community-study-room .desk-avatar {
  width: 30px;
  height: 30px;
  border: 1px solid var(--community-ref-line);
  background: #fff;
  color: var(--community-ref-brand);
  box-shadow: none;
}

/* Management: a straightforward settings form, not another card stack. */
.community-modern .community-customize {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

.community-modern .community-customize > summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  border: 0;
  border-bottom: 1px solid var(--community-ref-line);
  background: transparent;
  padding: 0 2px;
  color: var(--community-ref-ink);
  font-size: 14px;
  font-weight: 720;
}

.community-modern .community-customize > summary::after {
  margin-left: auto;
  color: var(--community-ref-muted);
}

.community-modern .community-customize[open] > summary {
  margin-bottom: 0;
  color: var(--community-ref-brand);
}

.community-modern .community-customize > form {
  gap: 0;
  border: 0;
  background: transparent;
  padding: 0;
}

.community-modern .community-customize > form > :is(input, textarea, select, label, .blog-toolbar, .community-setting-preview, .form-actions, .join-request-box) {
  margin: 0;
  border-bottom: 1px solid var(--community-ref-line);
  border-radius: 0;
  padding-top: 12px;
  padding-bottom: 12px;
}

.community-modern .community-customize :is(.input, .select, .textarea) {
  border-color: var(--community-ref-line);
  border-radius: 9px;
  background: #fff;
  box-shadow: none;
}

.community-modern .community-customize input[type="color"] {
  width: 48px;
  min-width: 48px;
  height: 38px;
  min-height: 38px;
  border-radius: 999px;
  padding: 3px;
}

.community-modern .community-setting-preview {
  min-height: 0;
}

.community-modern .community-setting-preview:empty {
  display: none;
}

.community-modern .community-setting-preview img {
  display: block;
  width: 100%;
  max-height: 160px;
  border: 1px solid var(--community-ref-line);
  border-radius: 9px;
  object-fit: cover;
  box-shadow: none;
}

.community-modern .community-customize .split-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  border-bottom: 0;
}

.community-modern .community-customize .split-actions > button {
  min-height: 42px;
  border-radius: 9px;
  box-shadow: none;
}

@media (max-width: 700px) {
  .community-modern .community-study-room .study-room-head {
    display: grid;
    gap: 10px;
  }

  .community-modern .community-study-room .study-room-head-actions {
    display: grid;
    justify-items: stretch;
  }

  .community-modern .community-study-room .study-summary-pills {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .community-modern .community-study-room .study-summary-pills > span {
    min-width: 0;
    padding: 7px 6px;
  }

  .community-modern .community-study-room .invite-button {
    width: 100%;
  }

  .community-modern .community-study-room .study-room-grid.visual-study-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .community-modern .community-study-room .study-timer-card,
  .community-modern .community-study-room .study-leaderboard,
  .community-modern .community-study-room .study-classroom {
    border-radius: 9px;
  }

  .community-modern .community-study-room .study-stopwatch-face {
    min-height: 104px;
  }

  .community-modern .community-study-room .study-stopwatch-face strong {
    font-size: 36px;
  }

  .community-modern .community-study-room .seat-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .community-modern .community-study-room .study-rank {
    grid-template-columns: 22px 28px minmax(0, 1fr) auto;
  }

  .community-modern .community-study-room .study-rank em {
    display: none;
  }

  .community-modern .community-customize .split-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .community-modern .community-customize .split-actions > button {
    width: 100%;
  }
}

/* Routed community directory and detail screens. */
.community-modern.community-directory-page {
  width: min(760px, 100%);
}

.community-modern .community-directory-shell {
  min-width: 0;
}

.community-directory-page .community-control-panel {
  width: 100%;
}

.community-directory-page .enhanced-board-list {
  max-height: none;
  overflow: visible;
  border-top: 1px solid var(--community-ref-line);
  border-bottom: 0;
}

.community-directory-page .enhanced-board-list .community-board {
  min-height: 98px;
  grid-template-columns: 62px minmax(0, 1fr) 42px;
  gap: 14px;
  padding: 13px 4px;
}

.community-directory-page .enhanced-board-list .board-type-icon {
  width: 62px;
  min-width: 62px;
  height: 62px;
  border-radius: 11px;
}

.community-modern .enhanced-board-list .board-type-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.community-modern .enhanced-board-list .board-type-icon img.official-community-icon {
  object-fit: contain;
  padding: 8px;
  background: #f4faf7;
}

.community-directory-page .enhanced-board-list .board-main {
  gap: 4px;
}

.community-directory-page .enhanced-board-list .board-main strong {
  font-size: 15px;
}

.community-modern .enhanced-board-list .board-meta {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 3px 9px;
  color: var(--community-ref-muted);
  font-size: 10.5px;
  font-style: normal;
  line-height: 1.35;
}

.community-modern .enhanced-board-list .board-meta i {
  overflow: hidden;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-directory-page .enhanced-board-list .board-stat {
  min-width: 42px;
  align-self: stretch;
  align-content: center;
  justify-items: center;
  color: var(--community-ref-muted);
}

.community-directory-page .enhanced-board-list .board-stat .icon {
  width: 18px;
  height: 18px;
}

.community-modern.community-detail-page {
  width: min(880px, 100%);
  gap: 0;
  overflow: visible;
}

.community-modern .community-detail-toolbar {
  display: grid;
  min-width: 0;
  min-height: 54px;
  grid-template-columns: minmax(110px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--community-ref-line);
  background: var(--community-ref-surface);
  padding: 0 2px;
}

.community-modern .community-detail-toolbar > strong {
  min-width: 0;
  overflow: hidden;
  color: var(--community-ref-ink);
  font-size: 15px;
  font-weight: 720;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-modern .community-back-button {
  width: fit-content;
  min-width: 0;
  min-height: 40px;
  justify-content: flex-start;
  gap: 5px;
  border: 0;
  background: transparent;
  padding: 0 8px 0 0;
  color: var(--community-ref-ink);
  box-shadow: none;
}

.community-modern .community-back-button:hover {
  background: transparent;
  color: var(--community-ref-brand);
  transform: none;
}

.community-modern .community-back-button .icon {
  width: 19px;
  height: 19px;
}

.community-modern .community-detail-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.community-modern .community-detail-actions > button {
  min-height: 38px;
  gap: 5px;
  border-radius: 9px;
  padding: 0 11px;
  box-shadow: none;
}

.community-modern .community-detail-actions > .ghost {
  border-color: var(--community-ref-line);
  background: #fff;
  color: var(--community-ref-ink);
}

.community-detail-page .community-main-panel {
  width: 100%;
  padding-top: 15px;
}

.community-detail-page .community-hero {
  margin: 0;
}

.community-detail-page .community-section-tabs {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  overflow: visible;
}

.community-detail-page .community-section-tabs > button {
  width: 100%;
  min-width: 0;
  padding-inline: 6px;
}

.community-detail-page :is(
  .community-posts-view,
  .community-info-view,
  .community-files-view,
  .community-members-view,
  .community-compose-view,
  .community-customize
) {
  display: grid;
  min-width: 0;
  max-width: 100%;
  gap: 14px;
  padding: 4px 0 0;
}

.community-modern .community-subview-head {
  display: flex;
  min-width: 0;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--community-ref-line);
  padding: 0 2px 10px;
}

.community-modern .community-subview-head > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.community-modern .community-subview-head strong {
  color: var(--community-ref-ink);
  font-size: 16px;
  font-weight: 730;
  line-height: 1.35;
}

.community-modern .community-subview-head span {
  color: var(--community-ref-muted);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
}

.community-modern .community-subview-head > b {
  flex: 0 0 auto;
  color: var(--community-ref-brand);
  font-size: 12px;
  font-weight: 700;
}

.community-modern .community-description {
  margin: 0;
  color: var(--community-ref-ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.community-modern .community-fact-list {
  display: grid;
  margin: 0;
  border-top: 1px solid var(--community-ref-line);
}

.community-modern .community-fact-list > div {
  display: grid;
  min-height: 48px;
  grid-template-columns: minmax(92px, 0.34fr) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--community-ref-line);
  padding: 0 2px;
}

.community-modern .community-fact-list :is(dt, dd) {
  min-width: 0;
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

.community-modern .community-fact-list dt {
  color: var(--community-ref-muted);
  font-weight: 560;
}

.community-modern .community-fact-list dd {
  color: var(--community-ref-ink);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.community-modern .community-focus-link {
  width: fit-content;
  min-height: 40px;
  border-color: var(--community-ref-line);
  border-radius: 9px;
  background: #fff;
  color: var(--community-ref-brand);
  box-shadow: none;
}

.community-modern .community-member-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--community-ref-line);
  border-bottom: 1px solid var(--community-ref-line);
}

.community-modern .community-member-summary > div {
  display: grid;
  min-width: 0;
  gap: 2px;
  border-right: 1px solid var(--community-ref-line);
  padding: 13px 10px;
  text-align: center;
}

.community-modern .community-member-summary > div:last-child {
  border-right: 0;
}

.community-modern .community-member-summary strong {
  min-width: 0;
  overflow: hidden;
  color: var(--community-ref-ink);
  font-size: 17px;
  font-weight: 740;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-modern .community-member-summary span {
  color: var(--community-ref-muted);
  font-size: 10.5px;
}

.community-modern .community-manager-list {
  display: grid;
  gap: 0;
}

.community-modern .community-manager-list h3 {
  margin: 0;
  border-bottom: 1px solid var(--community-ref-line);
  padding: 0 2px 9px;
  font-size: 13px;
  font-weight: 700;
}

.community-modern .community-manager-row {
  display: grid;
  min-width: 0;
  min-height: 54px;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--community-ref-line);
  padding: 8px 2px;
}

.community-modern .community-manager-row > div {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.community-modern .community-manager-row strong {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-modern .community-manager-row span {
  color: var(--community-ref-muted);
  font-size: 10.5px;
}

.community-modern .community-resource-feed {
  border-top: 0;
}

.community-modern .community-compose-view > .community-write {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.community-modern .community-route-empty {
  min-height: 260px;
}

.community-detail-page :is(img, video, canvas, iframe, table, pre, .content-box, .image-preview, .document-preview-list) {
  max-width: 100%;
}

.community-detail-page :is(.katex-display, pre, table, .document-preview-list) {
  overflow-x: auto;
}

.community-detail-page :is(input, textarea, select, button) {
  max-width: 100%;
}

@media (max-width: 700px) {
  .community-modern.community-directory-page,
  .community-modern.community-detail-page {
    width: 100%;
  }

  .community-directory-page .enhanced-board-list .community-board {
    min-height: 88px;
    grid-template-columns: 54px minmax(0, 1fr) 32px;
    gap: 10px;
    padding: 11px 1px;
  }

  .community-directory-page .enhanced-board-list .board-type-icon {
    width: 54px;
    min-width: 54px;
    height: 54px;
    border-radius: 10px;
  }

  .community-directory-page .enhanced-board-list .board-main small {
    -webkit-line-clamp: 1;
  }

  .community-directory-page .enhanced-board-list .board-stat small {
    display: none;
  }

  .community-modern .community-detail-toolbar {
    min-height: 50px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 7px;
    padding-inline: 0;
  }

  .community-modern .community-back-button {
    min-height: 38px;
    padding-right: 4px;
  }

  .community-modern .community-back-button span {
    display: none;
  }

  .community-modern .community-detail-toolbar > strong {
    font-size: 14px;
    text-align: left;
  }

  .community-modern .community-detail-actions {
    gap: 4px;
  }

  .community-modern .community-detail-actions > button {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    justify-content: center;
    padding: 0;
  }

  .community-modern .community-detail-actions > button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .community-detail-page .community-main-panel {
    gap: 11px;
    padding-top: 11px;
  }

  .community-detail-page .community-section-tabs {
    grid-auto-columns: minmax(0, 1fr);
  }

  .community-detail-page .community-section-tabs > button {
    min-height: 42px;
    gap: 3px;
    padding-inline: 2px;
    font-size: 10.5px;
  }

  .community-detail-page .community-section-tabs > button .icon {
    width: 14px;
    height: 14px;
  }

  .community-detail-page .community-section-tabs > button b:not(:empty) {
    display: none;
  }

  .community-detail-page :is(
    .community-posts-view,
    .community-info-view,
    .community-files-view,
    .community-members-view,
    .community-compose-view,
    .community-customize
  ) {
    gap: 11px;
    padding-top: 2px;
  }

  .community-modern .community-subview-head {
    min-height: 46px;
    gap: 8px;
    padding-bottom: 9px;
  }

  .community-modern .community-subview-head strong {
    font-size: 15px;
  }

  .community-modern .community-subview-head span {
    font-size: 10.5px;
  }

  .community-modern .community-fact-list > div {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px;
  }

  .community-modern .community-member-summary > div {
    padding: 11px 5px;
  }

  .community-modern .community-member-summary strong {
    font-size: 14px;
  }

  .community-modern .community-focus-link {
    width: 100%;
  }
}

@media (max-width: 370px) {
  .community-detail-page .community-section-tabs > button .icon {
    display: none;
  }

  .community-detail-page .community-section-tabs > button {
    font-size: 10px;
  }
}

/* Study-room creation: one decision flow with a faithful list preview. */
body.has-community-create {
  overflow: hidden;
}

/*
 * The creation dialog is mounted beside .app-shell, not inside the directory
 * content. This dedicated layer prevents container overflow, sticky headers,
 * and the mobile tab bar from clipping or covering the dialog.
 */
#app > .community-create-overlay-root {
  position: fixed;
  z-index: 6000;
  inset: 0;
  width: 100%;
  height: 100dvh;
  pointer-events: none;
  isolation: isolate;
}

#app > .community-create-overlay-root .community-create-modal {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  pointer-events: auto;
}

#app > .community-create-overlay-root :is(.community-create-backdrop, .community-create-dialog) {
  pointer-events: auto;
}

body.has-community-create .toast {
  z-index: 6100 !important;
}

.community-modern .community-create-modal {
  padding: 24px;
}

.community-modern .community-create-backdrop {
  background: rgb(13 27 21 / 46%);
  backdrop-filter: blur(2px);
}

.community-modern .community-create-dialog {
  display: block;
  width: min(780px, calc(100vw - 48px));
  max-width: 780px;
  max-height: min(820px, calc(100dvh - 48px));
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--community-ref-line-strong);
  border-top: 1px solid var(--community-ref-line-strong);
  border-radius: 8px;
  background: var(--community-ref-surface);
  padding: 0;
  color: var(--community-ref-ink);
  box-shadow: 0 24px 72px rgb(10 26 19 / 24%);
  overscroll-behavior: contain;
}

.community-modern .community-create-form-head {
  position: sticky;
  z-index: 4;
  top: 0;
  display: flex;
  min-height: 82px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--community-ref-line);
  background: rgb(255 255 255 / 97%);
  padding: 18px 20px 15px;
  backdrop-filter: blur(10px);
}

.community-modern .community-create-form-head > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.community-modern .community-create-form-head .workspace-kicker {
  color: var(--community-ref-brand);
  font-size: 11px;
  font-weight: 750;
}

.community-modern .community-create-form-head strong {
  color: var(--community-ref-ink);
  font-size: 21px;
  font-weight: 760;
  line-height: 1.3;
}

.community-modern .community-create-form-head p {
  margin: 2px 0 0;
  color: var(--community-ref-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.community-modern .community-create-form-head > .icon-only {
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--community-ref-muted);
  padding: 0;
}

.community-modern .community-create-form-head > .icon-only:hover {
  background: var(--community-ref-subtle);
  color: var(--community-ref-ink);
}

.community-modern .community-create-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  align-items: stretch;
}

.community-modern .community-create-fields {
  display: grid;
  min-width: 0;
  gap: 20px;
  padding: 20px;
}

.community-modern .community-create-group {
  display: grid;
  min-width: 0;
  gap: 8px;
  margin: 0;
  border: 0;
  padding: 0;
}

.community-modern .community-create-group > legend,
.community-modern .community-create-label b {
  color: var(--community-ref-ink);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.4;
}

.community-modern .community-create-group > p {
  margin: -5px 0 1px;
  color: var(--community-ref-muted);
  font-size: 11px;
  line-height: 1.45;
}

.community-modern .community-purpose-options,
.community-modern .community-access-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.community-modern :is(.community-purpose-option, .community-access-option) {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 68px;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  cursor: pointer;
  border: 1px solid var(--community-ref-line);
  border-radius: 8px;
  background: var(--community-ref-surface);
  padding: 10px;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.community-modern :is(.community-purpose-option, .community-access-option):hover {
  border-color: var(--community-ref-line-strong);
  background: var(--community-ref-subtle);
}

.community-modern :is(.community-purpose-option, .community-access-option):has(input:checked) {
  border-color: var(--community-ref-brand);
  background: var(--community-ref-brand-soft);
}

.community-modern :is(.community-purpose-option, .community-access-option):has(input:focus-visible) {
  outline: 3px solid rgb(8 116 84 / 14%);
  outline-offset: 1px;
}

.community-modern :is(.community-purpose-option, .community-access-option) > input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.community-modern :is(.community-purpose-icon, .community-access-icon) {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--community-ref-subtle);
  color: var(--community-ref-muted);
}

.community-modern :is(.community-purpose-option, .community-access-option):has(input:checked) :is(.community-purpose-icon, .community-access-icon) {
  background: var(--community-ref-surface);
  color: var(--community-ref-brand);
}

.community-modern :is(.community-purpose-icon, .community-access-icon) .icon {
  width: 17px;
  height: 17px;
}

.community-modern :is(.community-purpose-option, .community-access-option) > span:last-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.community-modern :is(.community-purpose-option, .community-access-option) strong {
  color: var(--community-ref-ink);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.35;
}

.community-modern :is(.community-purpose-option, .community-access-option) small {
  color: var(--community-ref-muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
}

.community-modern .community-create-field {
  display: grid;
  min-width: 0;
  gap: 7px;
  color: var(--community-ref-ink);
}

.community-modern .community-create-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.community-modern .community-create-label small {
  color: var(--community-ref-muted);
  font-size: 10px;
  font-weight: 550;
}

.community-modern .community-create-field :is(.input, .textarea) {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--community-ref-line);
  border-radius: 8px;
  background: var(--community-ref-surface);
  color: var(--community-ref-ink);
  box-shadow: none;
}

.community-modern .community-create-field .input {
  min-height: 46px;
  padding-inline: 13px;
}

.community-modern .community-create-field .compact-textarea {
  min-height: 84px;
  padding: 11px 13px;
  resize: vertical;
}

.community-modern .community-create-field :is(.input, .textarea):focus {
  border-color: var(--community-ref-brand);
  outline: 3px solid rgb(8 116 84 / 10%);
  outline-offset: 0;
}

.community-modern .community-color-options {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.community-modern .community-create-swatch {
  position: relative;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  border: 2px solid var(--community-ref-surface);
  border-radius: 50%;
  background: var(--swatch);
  padding: 0;
  box-shadow: 0 0 0 1px var(--community-ref-line);
}

.community-modern .community-create-swatch[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--community-ref-ink);
}

.community-modern .community-create-swatch[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg) translate(-1px, -1px);
}

.community-modern .community-custom-color {
  position: relative;
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  cursor: pointer;
}

.community-modern .community-custom-color input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.community-modern .community-custom-color span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--community-ref-line);
  border-radius: 8px;
  background: var(--community-ref-surface);
  padding: 0 10px;
  color: var(--community-ref-muted);
  font-size: 11px;
  font-weight: 650;
}

.community-modern .community-custom-color:has(input:focus-visible) span {
  outline: 3px solid rgb(8 116 84 / 14%);
  outline-offset: 1px;
}

.community-modern .community-custom-color .icon {
  width: 14px;
  height: 14px;
}

.community-modern .community-create-preview {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 12px;
  border-left: 1px solid var(--community-ref-line);
  background: var(--community-ref-subtle);
  padding: 20px;
}

.community-modern .community-preview-kicker {
  color: var(--community-ref-muted);
  font-size: 10px;
  font-weight: 720;
}

.community-modern .community-create-preview-card {
  display: grid;
  min-width: 0;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 11px;
  border: 1px solid var(--community-ref-line);
  border-radius: 8px;
  background: var(--community-ref-surface);
  padding: 13px;
}

.community-modern .community-create-preview-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--create-color) 12%, #fff);
  color: var(--create-color);
}

.community-modern .community-create-preview-icon .icon {
  width: 21px;
  height: 21px;
}

.community-modern .community-create-preview-card > div {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 4px;
}

.community-modern .community-create-preview-type {
  color: var(--create-color);
  font-size: 10px;
  font-weight: 720;
}

.community-modern .community-create-preview-card strong {
  overflow: hidden;
  color: var(--community-ref-ink);
  font-size: 13px;
  font-weight: 740;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-modern .community-create-preview-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--community-ref-muted);
  font-size: 10px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.community-modern .community-create-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--community-ref-muted);
  font-size: 9.5px;
  font-weight: 580;
}

.community-modern .community-create-preview-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  color: var(--community-ref-muted);
  font-size: 10px;
  line-height: 1.5;
}

.community-modern .community-create-preview-note .icon {
  width: 14px;
  min-width: 14px;
  height: 14px;
  margin-top: 1px;
  color: var(--community-ref-brand);
}

.community-modern .community-create-footer {
  position: sticky;
  z-index: 4;
  bottom: 0;
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--community-ref-line);
  background: rgb(255 255 255 / 97%);
  padding: 10px 20px;
  backdrop-filter: blur(10px);
}

.community-modern .community-create-footer > span {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  color: var(--community-ref-muted);
  font-size: 10px;
  line-height: 1.4;
}

.community-modern .community-create-footer > span .icon {
  width: 14px;
  min-width: 14px;
  height: 14px;
  color: var(--community-ref-brand);
}

.community-modern .community-create-submit {
  width: auto;
  min-width: 156px;
  min-height: 44px;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: var(--community-ref-brand);
  color: #fff;
  padding: 0 16px;
  box-shadow: none;
}

.community-modern .community-create-submit:hover {
  background: var(--community-ref-brand-strong);
}

.community-modern .community-create-dialog.is-submitting {
  pointer-events: none;
}

@media (max-width: 760px) {
  .community-modern .community-create-modal {
    place-items: end stretch;
    padding: 0;
  }

  .community-modern .community-create-dialog {
    width: 100%;
    max-width: none;
    max-height: min(90dvh, 780px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 8px 8px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -18px 54px rgb(10 26 19 / 22%);
  }

  .community-modern .community-create-form-head {
    min-height: 74px;
    padding: 14px 16px 12px;
  }

  .community-modern .community-create-form-head strong {
    font-size: 19px;
  }

  .community-modern .community-create-form-head p {
    font-size: 10.5px;
  }

  .community-modern .community-create-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .community-modern .community-create-fields {
    gap: 18px;
    padding: 18px 16px;
  }

  .community-modern .community-create-preview {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    border-top: 1px solid var(--community-ref-line);
    border-left: 0;
    padding: 15px 16px;
  }

  .community-modern .community-create-preview-card {
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 11px;
  }

  .community-modern .community-create-preview-icon {
    width: 42px;
    height: 42px;
  }

  .community-modern .community-create-footer {
    min-height: 66px;
    padding: 9px 16px max(9px, env(safe-area-inset-bottom));
  }

  .community-modern .community-create-footer > span {
    display: none;
  }

  .community-modern .community-create-submit {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .community-modern .community-purpose-options,
  .community-modern .community-access-options {
    grid-template-columns: minmax(0, 1fr);
  }

  .community-modern .community-purpose-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .community-modern .community-purpose-option {
    min-height: 62px;
    grid-template-columns: 29px minmax(0, 1fr);
    gap: 7px;
    padding: 8px;
  }

  .community-modern .community-purpose-icon {
    width: 29px;
    height: 29px;
  }

  .community-modern .community-purpose-option small {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .community-modern :is(.community-purpose-option, .community-access-option) {
    transition: none;
  }
}
