:root {
  --gmk-feed-line: rgba(232, 213, 164, .16);
  --gmk-feed-muted: rgba(241, 237, 226, .62);
  --gmk-feed-gold: #e4ca84;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.community-layout--cinematic {
  align-items: start;
}

.post-list {
  gap: 14px !important;
}

.post-card.gmk-compact-card {
  position: relative;
  padding: 20px 22px 16px !important;
  border-radius: 8px !important;
  cursor: pointer;
  overflow: hidden;
}

.post-card.gmk-compact-card:hover {
  border-color: rgba(228, 202, 132, .3);
}

.post-card.gmk-compact-card:focus-visible {
  outline: 2px solid var(--gmk-feed-gold);
  outline-offset: 3px;
}

.gmk-compact-card .post-head {
  display: grid !important;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  margin-bottom: 13px !important;
}

.gmk-compact-card .post-head > img {
  width: 44px !important;
  height: 44px !important;
}

.gmk-compact-card .post-head > div:nth-child(2) {
  min-width: 0;
}

.gmk-compact-card .post-head strong,
.gmk-compact-card .post-head span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gmk-post-title {
  margin: 0 0 8px;
  color: #f5efe1;
  font-family: "Songti SC", "Noto Serif SC", serif;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0;
}

.gmk-compact-card .post-body {
  display: -webkit-box;
  margin: 0 !important;
  overflow: hidden;
  color: var(--gmk-feed-muted) !important;
  font-size: 15px !important;
  line-height: 1.72 !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.gmk-compact-card .tag-row,
.gmk-compact-card > .gmk-reply-preview,
.gmk-compact-card > .community-comments {
  display: none !important;
}

.gmk-compact-card .post-actions {
  display: flex !important;
  min-height: 38px;
  margin-top: 14px !important;
  padding-top: 12px !important;
  gap: 4px !important;
  border-top: 1px solid rgba(255, 255, 255, .075);
}

.gmk-compact-card .post-actions button {
  min-width: 38px;
  min-height: 38px;
  padding: 7px 9px !important;
}

.gmk-open-post {
  margin-right: auto;
  color: var(--gmk-feed-gold) !important;
  font-weight: 600 !important;
}

.gmk-author-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gmk-gender {
  display: inline;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #d9c58f;
  font-size: 13px;
  line-height: inherit;
}

.gmk-gender[hidden] {
  display: none;
}

.gmk-follow-button {
  min-width: 62px;
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid rgba(228, 202, 132, .38);
  border-radius: 6px;
  background: rgba(228, 202, 132, .08);
  color: var(--gmk-feed-gold);
  font-size: 12px;
  cursor: pointer;
}

.gmk-follow-button.is-following {
  border-color: rgba(255, 255, 255, .13);
  background: transparent;
  color: rgba(255, 255, 255, .58);
}

.composer-topic.gmk-title-field {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.composer-topic.gmk-title-field > span {
  min-width: 42px;
  color: var(--gmk-feed-gold);
  font-size: 13px;
  font-weight: 600;
}

.composer-topic.gmk-title-field input {
  min-width: 0;
}

.gmk-scope-notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 16px;
  margin: 0 0 14px;
  padding: 16px 18px;
  border: 1px solid rgba(228, 202, 132, .2);
  border-radius: 8px;
  background: rgba(228, 202, 132, .055);
}

.gmk-scope-notice strong,
.gmk-scope-notice span {
  min-width: 0;
}

.gmk-scope-notice span {
  color: var(--gmk-feed-muted);
  font-size: 13px;
}

.gmk-scope-notice a {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  color: var(--gmk-feed-gold);
}

#gmk-beta-reward-entry[hidden] {
  display: none !important;
}

body.gmk-modal-open {
  overflow: hidden;
}

.gmk-modal-open .gmk-gift-launch {
  display: none !important;
}

.gmk-post-modal[hidden] {
  display: none;
}

.gmk-post-modal {
  position: fixed;
  z-index: 9999;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
}

.gmk-post-modal__scrim {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, .76);
  backdrop-filter: blur(8px);
}

.gmk-post-modal__panel {
  position: relative;
  width: min(680px, 100%);
  max-height: min(86vh, 860px);
  overflow: auto;
  border: 1px solid rgba(228, 202, 132, .22);
  border-radius: 8px;
  background: #0b0a0d;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
  color: #f3eee2;
}

.gmk-post-modal__top {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: rgba(11, 10, 13, .96);
}

.gmk-post-modal__top span {
  color: rgba(255, 255, 255, .58);
  font-size: 12px;
}

.gmk-post-modal__close {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  color: #f3eee2;
  font-size: 25px;
  cursor: pointer;
}

.gmk-post-modal__content {
  padding: 22px;
}

.gmk-detail-author {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
}

.gmk-detail-author img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.gmk-detail-author div {
  display: grid;
  min-width: 0;
}

.gmk-detail-author strong,
.gmk-detail-author span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gmk-detail-author span {
  color: rgba(255, 255, 255, .48);
  font-size: 12px;
}

.gmk-detail-author i {
  color: var(--gmk-feed-gold);
  font-size: 12px;
  font-style: normal;
}

.gmk-post-modal h2 {
  margin: 22px 0 12px;
  color: #f7f0de;
  font-family: "Songti SC", "Noto Serif SC", serif;
  font-size: 25px;
  line-height: 1.42;
  letter-spacing: 0;
}

.gmk-detail-body {
  margin: 0;
  color: rgba(246, 242, 232, .82);
  font-size: 16px;
  line-height: 1.9;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.gmk-detail-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.gmk-detail-topics span {
  color: rgba(228, 202, 132, .72);
  font-size: 12px;
}

.gmk-detail-stats {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 20px;
  padding: 13px 0;
  border-top: 1px solid rgba(255, 255, 255, .08);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .55);
  font-size: 13px;
}

.gmk-detail-stats button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--gmk-feed-gold);
  cursor: pointer;
}

.gmk-detail-stats .gmk-detail-like {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 0;
  color: rgba(255, 255, 255, .68);
}

.gmk-detail-stats .gmk-detail-like.is-liked {
  color: #ee7b91;
}

.gmk-detail-stats .gmk-detail-like:disabled {
  cursor: wait;
  opacity: .58;
}

.gmk-detail-stats .gmk-detail-delete,
.gmk-detail-stats [data-gmk-detail-gift] {
  margin-left: auto;
}

.gmk-detail-comments {
  margin-top: 22px;
}

.gmk-detail-comments > h3 {
  margin: 0 0 14px;
  font-size: 16px;
}

.gmk-detail-comment {
  padding: 13px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.gmk-detail-comment strong {
  color: #d9c58f;
  font-size: 12px;
}

.gmk-detail-comment p,
.gmk-detail-empty {
  margin: 5px 0 0;
  color: rgba(255, 255, 255, .68);
  font-size: 14px;
  line-height: 1.7;
}

.gmk-detail-form {
  margin-top: 18px;
}

.gmk-detail-form textarea {
  width: 100%;
  min-height: 86px;
  resize: vertical;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 6px;
  background: rgba(255, 255, 255, .035);
  color: #f5efe1;
  font: inherit;
  line-height: 1.6;
  padding: 12px;
}

.gmk-detail-form > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.gmk-detail-form small {
  color: rgba(228, 202, 132, .78);
}

.gmk-detail-form small.is-error {
  color: #ff9b91;
}

.gmk-detail-form button {
  min-width: 76px;
  min-height: 38px;
  border: 1px solid rgba(228, 202, 132, .38);
  border-radius: 6px;
  background: rgba(228, 202, 132, .08);
  color: var(--gmk-feed-gold);
  cursor: pointer;
}

@media (max-width: 720px) {
  .post-list {
    gap: 10px !important;
  }

  .post-card.gmk-compact-card {
    padding: 15px 14px 12px !important;
  }

  .gmk-compact-card .post-head {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 9px;
    margin-bottom: 10px !important;
  }

  .gmk-compact-card .post-head > img {
    width: 38px !important;
    height: 38px !important;
  }

  .gmk-post-title {
    margin-bottom: 6px;
    font-size: 17px;
    line-height: 1.4;
  }

  .gmk-compact-card .post-body {
    font-size: 14px !important;
    line-height: 1.62 !important;
    -webkit-line-clamp: 2;
  }

  .gmk-compact-card .post-actions {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .gmk-compact-card .post-actions::-webkit-scrollbar {
    display: none;
  }

  .gmk-compact-card .post-actions button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .gmk-author-controls {
    gap: 5px;
  }

  .gmk-gender {
    width: auto;
    height: auto;
    font-size: 12px;
  }

  .gmk-follow-button {
    min-width: 52px;
    min-height: 30px;
    padding: 5px 8px;
  }

  .gmk-scope-notice {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .gmk-scope-notice a {
    grid-column: 1;
    grid-row: auto;
    margin-top: 7px;
  }

  .gmk-post-modal {
    align-items: end;
    padding: 0;
  }

  .gmk-post-modal__panel {
    width: 100%;
    max-height: 92dvh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 8px 8px 0 0;
  }

  .gmk-post-modal__content {
    padding: 17px 15px calc(22px + env(safe-area-inset-bottom));
  }

  .gmk-post-modal h2 {
    margin-top: 18px;
    font-size: 21px;
  }

  .gmk-detail-body {
    font-size: 15px;
    line-height: 1.82;
  }
}

@media (prefers-reduced-motion: reduce) {
  .post-card.gmk-compact-card,
  .gmk-follow-button {
    transition: none !important;
  }
}

/* Two-column discovery grid: compact text tiles, full content remains in the detail sheet. */
.route-community #community-feed {
  top: calc(var(--gmk-nav-height, 56px) + var(--gmk-community-subnav-height, 44px) + 6px) !important;
  z-index: 66;
}

.post-list {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px !important;
  align-items: stretch;
}

.post-list > :not(.post-card) {
  grid-column: 1 / -1;
}

.post-card.gmk-compact-card {
  min-width: 0;
  aspect-ratio: 1;
  padding: 14px !important;
  display: flex !important;
  flex-direction: column;
  border-radius: 8px !important;
}

.gmk-compact-card .post-head {
  display: grid !important;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 34px;
  margin: 0 0 12px !important;
}

.gmk-compact-card .post-head > img {
  width: 32px !important;
  height: 32px !important;
}

.gmk-compact-card .post-head > div:nth-child(2) {
  min-width: 0;
  line-height: 1.15;
}

.gmk-compact-card .post-head .gmk-author-line {
  display: flex !important;
  flex-flow: row nowrap !important;
  align-items: center !important;
  gap: 4px;
  width: 100%;
  min-width: 0;
  height: 18px;
  overflow: hidden;
}

.gmk-compact-card .post-head .gmk-author-line > strong {
  display: block !important;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100% !important;
  line-height: 18px !important;
}

.gmk-compact-card .post-head strong {
  display: inline-block !important;
  max-width: calc(100% - 22px);
  font-size: 12px !important;
  vertical-align: middle;
}

.gmk-compact-card .post-head > div:nth-child(2) > span:not(.gmk-gender) {
  display: block !important;
  margin-top: 3px;
  font-size: 9px !important;
}

.gmk-compact-card .post-head > .status-pill {
  display: inline-flex !important;
}

.gmk-gender {
  display: inline-block;
  flex: none;
  width: auto;
  height: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #e7cf91;
  font-size: 13px;
  font-weight: 700;
  line-height: 18px;
  transform: none;
  vertical-align: baseline;
}

.gmk-compact-card .post-head .gmk-author-line > .gmk-gender {
  display: inline-block !important;
  position: static !important;
  flex: 0 0 auto !important;
  align-self: baseline !important;
}

.gmk-compact-card .post-head .gmk-author-line > .gmk-gender[hidden] {
  display: none !important;
}

.gmk-gender.is-male {
  background: transparent;
  color: #72bdff;
}

.gmk-gender.is-female {
  background: transparent;
  color: #ff8fba;
}

.gmk-gender.is-other {
  color: #e7cf91;
}

.gmk-author-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  align-self: start;
}

.gmk-follow-button {
  min-width: 48px;
  min-height: 27px;
  padding: 4px 7px;
  border-radius: 5px;
  font-size: 10px;
}

.gmk-delete-post {
  min-width: 42px;
  min-height: 27px;
  padding: 4px 7px;
  border: 1px solid rgba(255, 121, 121, .42);
  border-radius: 5px;
  color: #ff9b9b;
  background: rgba(151, 45, 45, .12);
  font-size: 10px;
}

.gmk-delete-post:hover {
  border-color: rgba(255, 145, 145, .7);
  background: rgba(151, 45, 45, .2);
}

.gmk-detail-delete {
  color: #ff9b9b !important;
}

.gmk-compact-card .post-body {
  display: -webkit-box !important;
  position: relative;
  z-index: 1;
  min-height: 0;
  margin: 0 !important;
  overflow: hidden;
  pointer-events: none;
  color: #f5efe1 !important;
  font-size: 15px !important;
  font-weight: 600;
  line-height: 1.48 !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.gmk-compact-card .community-moderation-note {
  display: none !important;
}

.gmk-compact-card .post-actions {
  position: relative;
  z-index: 3;
  min-height: 32px;
  margin: auto 0 0 !important;
  padding: 8px 0 0 !important;
  overflow: hidden;
  gap: 2px !important;
  pointer-events: auto;
}

.gmk-compact-card .post-actions button {
  position: relative;
  z-index: 4;
  min-width: 30px;
  min-height: 30px;
  padding: 4px 5px !important;
  font-size: 11px;
}

.gmk-compact-card .post-actions button:nth-of-type(n+4) {
  display: none !important;
}

.gmk-open-post {
  width: auto;
  min-width: 0 !important;
  max-width: calc(100% - 76px);
  margin-right: auto;
  padding-left: 0 !important;
  overflow: hidden;
  color: var(--gmk-feed-gold) !important;
  font-size: 11px !important;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gmk-open-post::before {
  display: none;
}

.gmk-restricted-scope .post-list {
  display: grid !important;
}

.gmk-scope-notice {
  min-height: 64px;
}

.gmk-scope-notice:not(:has(a)) {
  grid-template-columns: minmax(0, 1fr);
}

.gmk-scope-notice:not(:has(a)) span {
  grid-column: 1;
}

@supports not selector(:has(*)) {
  .gmk-scope-notice {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

.gmk-action-notice {
  position: fixed;
  z-index: 12000;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(440px, calc(100vw - 28px));
  padding: 12px 14px;
  border: 1px solid rgba(228, 202, 132, .34);
  border-radius: 7px;
  background: rgba(12, 10, 9, .97);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
  color: rgba(255, 250, 240, .88);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .18s ease, transform .18s ease;
}

.gmk-action-notice.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.gmk-action-notice span {
  min-width: 0;
  flex: 1;
}

.gmk-action-notice a {
  flex: none;
  color: var(--gmk-feed-gold);
}

.gmk-official-scope .gmk-gift-launch {
  display: none !important;
}

.gmk-official-scope #gmk-beta-reward-entry {
  scroll-margin-top: calc(var(--gmk-nav-height, 56px) + var(--gmk-community-subnav-height, 44px) + 86px);
  margin-bottom: 112px;
}

@media (max-width: 1099px) {
  .post-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  html,
  body,
  button,
  input,
  textarea,
  select {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  .gmk-gift-launch {
    display: none !important;
  }

  .community-layout--cinematic {
    min-width: 0 !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .community-layout--cinematic > .community-feed {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .route-community #community-feed {
    top: calc(var(--gmk-nav-height, 152px) + var(--gmk-community-subnav-height, 44px) + 4px) !important;
    width: calc(100% - 16px) !important;
    margin-bottom: 10px !important;
    border-radius: 8px !important;
  }

  .route-community #community-feed button:not(.search-button) {
    min-width: 80px !important;
  }

  .post-list {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    grid-template-columns: minmax(0, calc((100% - 8px) / 2)) minmax(0, calc((100% - 8px) / 2));
    gap: 8px !important;
    overflow: hidden;
  }

  .post-card.gmk-compact-card {
    contain: inline-size;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 11px !important;
    overflow: hidden !important;
  }

  .post-card.gmk-compact-card > *,
  .post-card.gmk-compact-card .post-head,
  .post-card.gmk-compact-card .post-head > *,
  .post-card.gmk-compact-card .post-actions,
  .post-card.gmk-compact-card .post-actions > * {
    min-width: 0 !important;
    max-width: 100%;
  }

  .gmk-compact-card .post-head {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 6px;
    min-height: 30px;
    margin-bottom: 9px !important;
    overflow: hidden;
  }

  .gmk-compact-card .post-head > img {
    width: 28px !important;
    height: 28px !important;
  }

  .gmk-compact-card .post-head strong {
    font-size: 11px !important;
  }

  .gmk-compact-card .post-head > div:nth-child(2) > span:not(.gmk-gender) {
    display: none !important;
  }

  .gmk-gender {
    width: auto;
    height: auto;
    font-size: 12px;
  }

  .gmk-compact-card .post-head .gmk-author-line > .gmk-gender {
    flex-basis: auto !important;
    align-self: baseline !important;
  }

  .gmk-follow-button {
    min-width: 40px;
    min-height: 25px;
    padding-inline: 5px;
  }

  .gmk-post-title {
    font-size: 14px;
    line-height: 1.42;
    -webkit-line-clamp: 4;
  }

  .gmk-compact-card .post-body {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .gmk-compact-card .post-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 32px 32px;
    width: 100% !important;
    min-height: 29px;
    padding-top: 6px !important;
    overflow: hidden;
  }

  .gmk-compact-card .post-actions button {
    width: 100% !important;
    min-width: 27px;
    min-height: 27px;
    padding: 3px !important;
  }

  .gmk-compact-card .post-actions .gmk-open-post {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .gmk-action-notice {
    bottom: calc(92px + env(safe-area-inset-bottom));
  }

  .gmk-official-scope #gmk-beta-reward-entry {
    margin-bottom: 128px;
  }
}
