.wp-posts-content .zmt-operations-image-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: min(100%, 540px);
  margin: 18px 0 24px;
}

.zmt-operations-list-preview {
  display: block;
  max-width: 720px;
  margin-top: 10px;
  color: #4f5863;
  font-size: 15px;
}

.zmt-operations-list-preview-body {
  display: block;
  max-height: 7.2em;
  overflow: hidden;
  color: #505963;
  line-height: 1.8;
}

.zmt-operations-list-preview.is-expanded .zmt-operations-list-preview-body {
  max-height: none;
}

.zmt-operations-preview-line {
  display: block;
  min-height: 1.8em;
  white-space: pre-wrap;
}

.zmt-operations-expand {
  display: inline-block;
  margin-top: 6px;
  color: #2f80c9;
  font-size: 14px;
  cursor: pointer;
}

.zmt-operations-list-attachments {
  display: grid;
  gap: 8px;
  max-width: 720px;
  margin: 14px 0 4px;
}

.zmt-operations-list-attachment {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e5e9ee;
  border-radius: 8px;
  color: #26323d;
  background: #fafbfc;
  text-decoration: none;
}

.zmt-operations-list-attachment > span:nth-child(2) { min-width: 0; flex: 1; }
.zmt-operations-list-attachment strong,
.zmt-operations-list-attachment small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zmt-operations-list-attachment small { margin-top: 2px; color: #7a8490; font-size: 12px; }
.zmt-operations-attachment-type { min-width: 42px; padding: 5px 4px; border-radius: 5px; color: #145ea8; background: #eaf3fc; font-size: 11px; font-weight: 700; text-align: center; }

.zmt-operations-membership-modal[hidden] { display: none; }
.zmt-operations-membership-modal { position: fixed; z-index: 100001; inset: 0; display: grid; place-items: center; padding: 20px; }
.zmt-operations-membership-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .48); }
.zmt-operations-membership-panel { position: relative; width: min(420px, 100%); padding: 28px; border-radius: 12px; background: #fff; box-shadow: 0 18px 60px rgba(15, 23, 42, .22); }
.zmt-operations-membership-panel strong { display: block; color: #1e293b; font-size: 20px; }
.zmt-operations-membership-panel p { margin: 10px 0 20px; color: #64748b; line-height: 1.7; }
.zmt-operations-membership-action { display: inline-flex; padding: 10px 18px; border-radius: 7px; color: #fff; background: #e53935; text-decoration: none; }
.zmt-operations-membership-close { position: absolute; top: 10px; right: 12px; border: 0; color: #64748b; background: transparent; font-size: 24px; cursor: pointer; }

.zmt-operations-list-preview.is-expanded .zmt-operations-expand {
  display: none;
}

/* The forum theme applies a low-contrast gray to single-post content. Keep
   imported Knowledge Planet posts readable without changing native posts. */
.zmt-operations-imported-post .wp-posts-content,
.zmt-operations-imported-post .wp-posts-content p,
.zmt-operations-imported-post .wp-posts-content li,
.zmt-operations-imported-post .wp-posts-content blockquote {
  color: #26323d;
}

.zmt-operations-imported-post .wp-posts-content p,
.zmt-operations-imported-post .wp-posts-content li {
  font-size: 16px;
  line-height: 1.9;
}

.zmt-operations-imported-post .wp-posts-content a {
  color: #145ea8;
  text-decoration-color: rgba(20, 94, 168, .45);
}

.zmt-operations-imported-post .wp-posts-content a:hover,
.zmt-operations-imported-post .wp-posts-content a:focus {
  color: #0b477f;
}

.zmt-operations-list-preview .zmt-operations-image-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 4px;
  width: min(100%, 480px) !important;
  margin: 14px 0 4px;
}

.zmt-operations-list-preview .zmt-operations-image {
  display: block !important;
  aspect-ratio: 1 !important;
  overflow: hidden !important;
  cursor: zoom-in !important;
  border-radius: 5px;
  background: #f1f3f5;
}

.zmt-operations-list-preview .zmt-operations-image img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important;
}

.wp-posts-content .zmt-operations-image-grid.zmt-operations-image-count-1 {
  grid-template-columns: minmax(0, 360px);
}

.wp-posts-content .zmt-operations-image-grid.zmt-operations-image-count-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(100%, 440px);
}

.wp-posts-content .zmt-operations-image-grid .zmt-operations-image {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 4px;
  background: #f3f4f6;
}

.wp-posts-content .zmt-operations-image-grid img {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
}

.zmt-operations-lightbox {
  position: fixed;
  z-index: 100000;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(0, 0, 0, .76);
}

.zmt-operations-lightbox[hidden] {
  display: none;
}

.zmt-operations-lightbox img {
  display: block;
  max-width: min(92vw, 1200px);
  max-height: 86vh;
  object-fit: contain;
}

.zmt-operations-lightbox-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, .45);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.zmt-forum-reader-drawer {
  position: fixed;
  z-index: 99998;
  top: 0;
  right: 0;
  display: flex;
  width: min(860px, 92vw);
  height: 100vh;
  padding: 42px 0 0;
  background: #fff;
  box-shadow: -12px 0 32px rgba(20, 28, 38, .2);
  transform: translateX(105%);
  transition: transform .2s ease;
}

.zmt-forum-reader-drawer.is-open { transform: translateX(0); }
.zmt-forum-reader-drawer iframe { width: 100%; height: 100%; border: 0; }
.zmt-forum-reader-close {
  position: absolute;
  z-index: 1;
  top: 8px;
  left: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  color: #555;
  background: #f1f3f5;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 640px) {
  .wp-posts-content .zmt-operations-image-grid {
    gap: 5px;
    width: 100%;
  }
}
