
.dmmr-review, .dmmr-review * { box-sizing:border-box; }
.dmmr-review img { max-width:100%; height:auto; }
.dmmr-review > *, .dmmr-review section, .dmmr-review article, .dmmr-review div { min-width:0; }

/* Height-aware chapter layout: source order is preserved, single-column fallback below 760px. */
.dmmr-review .dmmr-v411-masonry {
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  grid-auto-rows:8px;
  grid-auto-flow:row dense;
  gap:16px !important;
  align-items:start !important;
}
.dmmr-review .dmmr-v411-masonry > * { align-self:start !important; height:auto !important; min-height:0 !important; margin:0 !important; }
.dmmr-review .dmmr-v411-masonry.is-single { grid-template-columns:minmax(0,1fr) !important; grid-auto-rows:auto; }
.dmmr-review .dmmr-v411-masonry.is-single > * { grid-row-end:auto !important; }

/* Compact all-sample shelf. Small files are loaded first; the official large file opens on demand. */
.dmmr-v411-sample-section { margin-block:clamp(28px,5vw,56px); }
.dmmr-v411-thumb-shelf {
  display:grid;
  grid-template-columns:repeat(8,minmax(0,1fr));
  gap:8px;
  margin-top:16px;
}
.dmmr-v411-thumb {
  appearance:none; border:1px solid rgba(36,30,40,.12); background:#fff; padding:0; margin:0;
  border-radius:8px; overflow:hidden; aspect-ratio:4/3; cursor:zoom-in; min-width:0;
  box-shadow:0 2px 8px rgba(24,18,28,.06); transition:transform .15s ease,box-shadow .15s ease;
}
.dmmr-v411-thumb:hover,.dmmr-v411-thumb:focus-visible { transform:translateY(-2px); box-shadow:0 7px 20px rgba(24,18,28,.14); outline:2px solid var(--dmmr-accent,#e85d9e); outline-offset:2px; }
.dmmr-v411-thumb img { display:block; width:100%; height:100% !important; object-fit:cover; }
.dmmr-v411-gallery-source, .dmmr-v411-original-gallery { display:none !important; }
.dmmr-v411-lightbox[hidden] { display:none !important; }
.dmmr-v411-lightbox { position:fixed; inset:0; z-index:999999; display:grid; place-items:center; padding:clamp(16px,4vw,44px); background:rgba(10,8,12,.88); }
.dmmr-v411-lightbox img { max-width:min(1180px,96vw); max-height:90vh; object-fit:contain; border-radius:8px; }
.dmmr-v411-lightbox__close { position:fixed; top:12px; right:12px; width:48px; height:48px; border:0; border-radius:50%; background:#fff; color:#222; font-size:32px; line-height:1; cursor:pointer; }
body.dmmr-v411-modal-open { overflow:hidden; }

/* Free-form review copy uses the card width and starts at the left edge instead of floating in a narrow centre column. */
.dmmr-v411-detail-section .dmmr-detail-review,
.dmmr-v411-detail-section .dmmr-detail-review__body,
.dmmr-v411-detail-section .dmmr-review-text,
.dmmr-v411-detail-section .dmmr-user-content,
.dmmr-v411-detail-section > div { max-width:none !important; width:100% !important; margin-inline:0 !important; }
.dmmr-v411-detail-section p { max-width:92ch; margin:0 0 1.35em 0 !important; line-height:1.9; text-align:left; }
.dmmr-v411-detail-section p:last-child { margin-bottom:0 !important; }
.dmmr-v411-detail-section .dmmr-time-badge { white-space:nowrap; }

/* Derived database/ranking shortcodes are inert until explicitly inserted into a page. */
.dmmr-v411-review-db { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.dmmr-v411-review-db__item { display:grid; grid-template-columns:100px minmax(0,1fr); gap:12px; padding:12px; border:1px solid rgba(36,30,40,.12); border-radius:10px; }
.dmmr-v411-review-db__thumb img { width:100%; height:auto; border-radius:6px; }
.dmmr-v411-review-db__item h3 { margin:0 0 8px; font-size:1rem; overflow-wrap:anywhere; }
.dmmr-v411-review-db__item p { margin:0; }
.dmmr-v411-ranking { display:grid; gap:8px; padding-left:1.5em; }
.dmmr-v411-ranking li { padding:10px 12px; border-bottom:1px solid rgba(36,30,40,.1); }
.dmmr-v411-ranking strong { float:right; margin-left:12px; }

@media (max-width:1024px) {
  .dmmr-v411-thumb-shelf { grid-template-columns:repeat(6,minmax(0,1fr)); }
  .dmmr-v411-review-db { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:760px) {
  .dmmr-review .dmmr-v411-masonry { grid-template-columns:minmax(0,1fr) !important; grid-auto-rows:auto; gap:14px !important; }
  .dmmr-review .dmmr-v411-masonry > * { grid-row-end:auto !important; }
  .dmmr-v411-thumb-shelf { grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; }
  .dmmr-v411-detail-section p { max-width:none; line-height:1.82; }
  .dmmr-v411-review-db { grid-template-columns:minmax(0,1fr); }
}
@media (max-width:430px) {
  .dmmr-v411-thumb-shelf { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .dmmr-v411-detail-section { padding-inline:0 !important; }
  .dmmr-v411-review-db__item { grid-template-columns:82px minmax(0,1fr); }
}
