:root {
  --bg: #f7f7f2;
  --panel: transparent;
  --border: #d7dce2;
  --accent: #1f5fbf;
  --text: #3c1f1a;
  --muted: #a63a32;
  --nav: #e9edf2;
  --meta-bg: #f2f5f9;
  --overlay: rgba(20, 24, 32, 0.75);
  --patch-med: 96;   /* px slice for main parchment */
  --patch-top: 72;   /* px slice for overlay parchment */
  --nav-height: 22px;
  --red-2: #a63a32;
  --red-3: #c04a40;
  --page-link: #3d6f62;
  --page-link-visited: #5a3c6a;
}

* {
  box-sizing: border-box;
}

body.theme-wiki {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg) url('./res/parchmentloop_bg.png') repeat;
  color: var(--text);
  line-height: 1.1;
  font-weight: 700; /* doubled default weight */
  text-shadow: 3px 3px 3px rgba(255, 255, 255, 0.375);
}

a {
  color: var(--page-link);
  text-decoration: none;
  font-weight: 1050; /* 150% of previous 700 */
  text-shadow: 3px 3px 3px rgba(255, 255, 255, 0.375);
  cursor: pointer;
}

/* Themed buttons (shared across scripted UIs) */
.btn-themed,
button:not(.nav-random-icon) {
  background: url('../reader/media/story/button_idle_unselected_available.png') center center / 100% 100% no-repeat;
  border: none;
  color: #2f1f14;
  font-weight: 800;
  padding: 8px 14px;
  border-radius: 6px;
  box-shadow: 1px 2px 3px rgba(0,0,0,0.15);
}
.btn-themed:hover,
button:not(.nav-random-icon):hover {
  background: url('../reader/media/story/button_current_selected.png') center center / 100% 100% no-repeat;
}
.btn-themed:disabled,
button:not(.nav-random-icon):disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.pager-floating a {
  background: url('../reader/media/story/button_idle_unselected_available.png') center center / 100% 100% no-repeat;
  padding: 6px 10px;
  border-radius: 6px;
  color: #2f1f14;
  font-weight: 800;
}
.pager-floating a:hover {
  background: url('../reader/media/story/button_current_selected.png') center center / 100% 100% no-repeat;
}

a:hover {
  text-decoration: underline;
}

  a:visited {
    color: var(--page-link-visited);
    text-shadow: 3px 3px 3px rgba(255, 255, 255, 0.375);
    cursor: pointer;
  }

  /* Make caret easily visible while editing */
  .edit-active, .edit-active * {
    caret-color: var(--text);
  }
  .edit-active .panel, .edit-active .panel * {
    caret-shape: block;
  }
  .edit-active .panel textarea,
  .edit-active .panel [contenteditable="true"] {
    caret-color: var(--text);
    caret-width: 3px;
  }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid #111;
  background: #000;
  position: sticky;
  top: 0;
  z-index: 1000;
  min-height: var(--nav-height);
  overflow: visible;
}

.brand a {
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  height: var(--nav-height);
  gap: 6px;
  text-decoration: none;
}

.nav-logo {
  display: block;
  height: calc(var(--nav-height) - 4px); /* 2px margin on top/bottom */
  width: auto;
  margin: 2px;
  object-fit: contain;
  flex-shrink: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.brand .nav-logo {
  display: block;
  height: 100%;
  width: auto;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
  position: relative;
  padding-bottom: 6px; /* enlarge hover area so dropdown stays open when moving down */
}

.nav-links a {
  padding: 4px 8px;
  border-radius: 5px;
  color: #7bcdbd;
  border: 1px solid transparent;
  font-weight: 700;
  text-shadow: 3px 3px 3px rgba(255, 255, 255, 0.375);
}

.nav-links a:hover {
  border-color: #7bcdbd;
  background: rgba(123, 205, 189, 0.1);
  text-shadow: 3px 3px 3px rgba(255, 255, 255, 0.375);
}

.nav-links a:visited {
  color: #64c8b4 !important;
  text-shadow: 3px 3px 3px rgba(255, 255, 255, 0.375);
}

.nav-links .nav-home {
  font-weight: 800;
  color: #fff;
  text-shadow: 3px 3px 3px rgba(255, 255, 255, 0.375);
}
.nav-links .nav-home:visited {
  color: #fff;
}
.nav-links .nav-home:hover {
  border-color: #fff;
}

.nav-links,
.brand {
  color: #fff;
}

.nav-dropdown {
  position: relative;
}
.nav-dropdown-toggle {
  display: inline-block;
  color: #7bcdbd;
  padding: 6px 10px;
  border-radius: 6px;
  font-weight: 700;
  text-shadow: 3px 3px 3px rgba(255, 255, 255, 0.375);
}
.nav-dropdown:hover .nav-dropdown-toggle {
  border: 1px solid #7bcdbd;
  background: rgba(123, 205, 189, 0.1);
}
.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  margin-top: 0;
  left: 0;
  background: #0f1118;
  border: 1px solid #1f2533;
  border-radius: 6px;
  min-width: 180px;
  box-shadow: 0 8px 18px rgba(0,0,0,0.35);
  display: none;
  flex-direction: column;
  padding: 6px 0;
  z-index: 1500;
}
.nav-dropdown:hover .nav-dropdown-menu {
  display: flex;
}
.nav-dropdown:focus-within .nav-dropdown-menu {
  display: flex;
}
.nav-dropdown-menu:hover {
  display: flex;
}
.nav-dropdown-menu a {
  padding: 8px 14px;
  border-radius: 0;
  color: #7bcdbd;
  border: none;
  text-shadow: none;
}
.nav-dropdown-menu a:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
}

.nav-btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.nav-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.nav-random {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-size: 18px 18px;
  background-repeat: no-repeat;
  background-position: 8px center;
  padding-left: 30px;
}
.nav-random.nav-random-icon {
  color: #fff;
  background-color: #1f5fbf;
  border-color: #1f5fbf;
}
.nav-random.nav-random-icon:hover {
  background-color: #184c98;
}

.content {
  max-width: 1500px;
  margin: 18px auto 48px;
  padding: 0 18px;
}

.panel {
  background: url('./res/parchmentloop_med.png') repeat-y;
  background-size: 140% auto; /* widen sheet to fill more center */
  background-position: center top;
  border: none;
  border-radius: 10px;
  padding: 16px;
  box-shadow: none;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--red-2);
  font-size: 18px; /* ~150% of previous */
  font-weight: 800;
  margin: 0 0 6px 0;
  text-shadow: 3px 3px 3px rgba(255, 255, 255, 0.375);
}
.breadcrumb {
  margin: 0 0 12px 0;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--red-2);
}
.breadcrumb a {
  color: var(--red-2);
  text-decoration: none;
}
.breadcrumb a:hover {
  text-decoration: underline;
}


h1 {
  margin: 0 0 12px 0;
  font-size: 28px;
  font-weight: 800; /* thicker titles */
  text-shadow: 3px 3px 3px rgba(255, 255, 255, 0.375);
}

p {
  color: var(--text);
  margin: 0 0 14px 0;
  font-weight: 700; /* restore normal weight */
}
ul, ol {
  color: var(--text);
  font-weight: 700; /* match normal text */
  margin: 0 0 14px 22px;
  padding-left: 18px;
}
li {
  font-weight: inherit;
}
li::marker {
  color: var(--text);
  font-weight: inherit;
}
strong, b {
  font-weight: 1400; /* thicker bold to stand out */
}

.link-list {
  list-style: disc;
  padding-left: 18px;
  margin: 12px 0 0;
}

.link-list li {
  margin-bottom: 8px;
  font-weight: 600;
  text-shadow: 3px 3px 3px rgba(255, 255, 255, 0.375);
}

.inline-link {
  font-weight: 600;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px 12px;
  background: var(--meta-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 10px 0 16px;
}

.meta-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 6px;
  align-items: baseline;
}

.meta-key {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.meta-value {
  color: var(--text);
  font-weight: 600;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  background: #eef2f8;
  color: var(--text);
  font-size: 12px;
  margin-left: 6px;
  border: 1px solid var(--border);
}

.markdown h2,
.markdown h3,
.markdown h4 {
  margin: 12px 0 6px;
  text-shadow: 3px 3px 3px rgba(255, 255, 255, 0.375);
  font-weight: 800;
}

/* Match heading styling even when placed outside markdown containers */
.panel h2,
.panel h3,
.panel h4 {
  margin: 12px 0 6px;
  text-shadow: 3px 3px 3px rgba(255, 255, 255, 0.375);
  font-weight: 800;
}

/* Preserve heading look for autolinked headings */
.markdown h1 a,
.markdown h2 a,
.markdown h3 a,
.markdown h4 a,
.panel h1 a,
.panel h2 a,
.panel h3 a,
.panel h4 a {
  color: var(--page-link);           /* use link color */
  text-decoration: none;             /* keep heading look */
  font-weight: inherit;              /* keep heading weight */
  text-shadow: inherit;              /* keep heading shadow */
}
.markdown h1 a:visited,
.markdown h2 a:visited,
.markdown h3 a:visited,
.markdown h4 a:visited,
.panel h1 a:visited,
.panel h2 a:visited,
.panel h3 a:visited,
.panel h4 a:visited {
  color: var(--page-link-visited);
  text-decoration: none;
}

/* Stronger override for autolinked headings */
.panel h1 a.auto-link,
.panel h2 a.auto-link,
.panel h3 a.auto-link,
.panel h4 a.auto-link,
.markdown h1 a.auto-link,
.markdown h2 a.auto-link,
.markdown h3 a.auto-link,
.markdown h4 a.auto-link {
  color: var(--page-link) !important;
  font-weight: inherit !important;
  text-shadow: inherit !important;
  text-decoration: none !important;
}
.panel h1 a.auto-link:visited,
.panel h2 a.auto-link:visited,
.panel h3 a.auto-link:visited,
.panel h4 a.auto-link:visited,
.markdown h1 a.auto-link:visited,
.markdown h2 a.auto-link:visited,
.markdown h3 a.auto-link:visited,
.markdown h4 a.auto-link:visited {
  color: var(--page-link-visited) !important;
  text-decoration: none !important;
}

.markdown ul,
.markdown ol {
  margin: 0 0 12px 22px;
}

.markdown code {
  background: #f0f3f8;
  padding: 2px 4px;
  border-radius: 4px;
}

.markdown pre {
  background: #f0f3f8;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  overflow: auto;
}

.markdown table {
  border-collapse: collapse;
  width: 100%;
  margin: 12px 0;
}

.markdown th,
.markdown td {
  border: 1px solid var(--border);
  padding: 8px;
  text-align: left;
}

.callout,
.media-placeholder {
  background: url('./res/parchmentloop_top.png') repeat;
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 14px 0;
  color: var(--text);
}

.callout strong {
  color: var(--text);
}

/* Filters */
.filters {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(160px, 1fr);
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 6px;
  margin: 12px 0;
  align-items: end;
}

.filters label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0;
  display: block;
  grid-row: 1;
}

.filters input,
.filters select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  grid-row: 2;
}

.media-frame {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: url('./res/parchmentloop_top.png') repeat;
  padding: 8px;
  margin: 12px 0;
  box-shadow: 0 4px 10px rgba(255, 255, 255, 0.25);
}
/* Meta toggle */
details.meta-toggle {
  margin-top: 1.2rem;
}
details.meta-toggle summary {
  cursor: pointer;
  font-weight: 600;
}
details.meta-toggle .meta-grid {
  margin-top: 0.5rem;
}

/* Media gallery */
.media-gallery {
  margin: 12px 0 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.8);
  max-height: 25vh;
  overflow: auto;
}

.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.gallery-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gallery-controls input[type="file"],
.gallery-controls input[type="text"],
.gallery-controls input[type="number"] {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.gallery-controls label {
  font-size: 12px;
  color: var(--muted);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.media-thumb {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  min-height: 120px;
}

.media-thumb img,
.media-thumb video {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.media-thumb .thumb-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 8px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.6));
  color: #fff;
  font-weight: 600;
  font-size: 13px;
}

.thumb-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 6px;
}

.thumb-actions button {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 6px;
  padding: 4px 6px;
  cursor: pointer;
}

.thumb-actions button:hover {
  background: #fff;
}

.gallery-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.overlay-frame {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  background: url('./res/parchmentloop_top.png') repeat;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.overlay-frame img,
.overlay-frame video {
  max-width: 100%;
  max-height: 70vh;
  display: block;
  margin: 0 auto;
}

.overlay-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-weight: 700;
}

.overlay-nav {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
}

.overlay-nav button {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-weight: 700;
}

.edit-bar {
  position: fixed;
  bottom: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  background: rgba(20, 24, 32, 0.9);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.edit-bar .edit-format-row {
  display: flex;
  gap: 6px;
}
.edit-bar .edit-format-row button {
  padding: 3px 6px;
  font-size: 12px;
  line-height: 1.1;
  height: 50%;
}
.edit-bar button {
  background: #2f80ed;
  border: none;
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}
.edit-bar button.secondary {
  background: #444b5a;
}
.edit-bar button.danger {
  background: #a63a32;
}
.edit-bar button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.edit-active .panel {
  outline: 2px dashed rgba(255,255,255,0.25);
}
.edit-active .panel .markdown {
  outline: 1px dashed rgba(255,255,255,0.3);
}
.inline-remove {
  display: none;
  margin-right: 6px;
  background: #a63a32;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
}
.edit-active .inline-remove {
  display: inline-block;
}
.inline-remove:hover {
  opacity: 0.9;
}
.inline-media-wrap {
  position: relative;
  display: block;
  width: 100%;
}
.inline-media-wrap img.inline-image,
.inline-media-wrap video.inline-video {
  position: relative;
  z-index: 1;
}
.inline-remove-media {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 5;
  display: none !important;
  background: #a63a32;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
}
.inline-edit-media {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 5;
  display: none !important;
  background: #f2cf63;
  color: #5a3b00;
  border: none;
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
}
.edit-active .inline-remove-media,
  .edit-active .inline-edit-media { display: inline-block !important; }
.inline-size {
  position: absolute;
  bottom: 4px;
  z-index: 5;
  display: none !important;
  background: #f2cf63;
  color: #5a3b00;
  border: none;
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
}
.inline-size-down { left: 4px; }
.inline-size-up { right: 4px; }
.edit-active .inline-size { display: inline-block !important; }
.inline-align-group {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: none !important;
  z-index: 5;
  gap: 4px;
  user-select: none;
}
.inline-align {
  background: #d9f2ff;
  color: #00314f;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
}
.edit-active .inline-align-group {
  display: inline-flex !important;
}
.inline-move {
  display: none;
  margin: 0 2px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: #2c2c2c;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  font-size: 13px;
  line-height: 1.1;
  min-width: 32px;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.inline-move-group {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  z-index: 7;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 6px;
  gap: 6px;
  pointer-events: auto;
  min-width: 96px;
  justify-content: center;
}
.edit-active .inline-move-group {
  display: inline-flex;
}
.edit-active .inline-move {
  display: inline-flex;
}
.inline-move:hover {
  background: #ffe9ae;
}
.link-editor-add {
  display: none;
  margin-top: 8px;
}
.edit-active .link-editor-add {
  display: block;
}
.inline-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 12px auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  padding: 2px;
}
.inline-video {
  display: block;
  max-width: 100%;
  margin: 12px auto;
  max-height: 135vh;
  cursor: zoom-in;
}
.inline-media-missing {
  display: block;
  width: 100%;
  min-height: 120px;
  border: 1px dashed var(--red-2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--red-2);
  padding: 10px;
  text-align: center;
  font-weight: 800;
}
.inline-image {
  cursor: zoom-in;
}
.inline-media-block {
  display: block;
  text-align: center;
  margin: 12px 0;
}
.inline-media-block img,
.inline-media-block video {
  display: inline-block;
}

  .pager {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 4px 0 8px;
    align-items: center;
    justify-content: center;
  }
  .pager-floating {
    position: fixed;
    left: 50%;
    top: 32px;
    transform: translateX(-50%) scale(0.45);
    transform-origin: center top;
    z-index: 2000;
    background: rgba(128, 128, 128, 0.75);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 6px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
  }
  .pager a {
    padding: 3px 6px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.85);
    font-weight: 700;
  }
.pager a:hover {
  background: rgba(255, 255, 255, 1);
}

.timer-status {
  font-size: 12px;
  color: var(--muted);
}

.page-cover {
  margin: 6px 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.page-cover img {
  width: 100%;
  display: block;
  object-fit: cover;
}

.turnaround-strip {
  margin: 10px 0 16px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.85);
}

.turnaround-header {
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
}

.turnaround-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(160px, 1fr);
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.turnaround-frame {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
}

.turnaround-frame img {
  width: 100%;
  height: 180px;
  max-height: 33vh;
  object-fit: contain;
  display: block;
}

.side-strip {
  position: fixed;
  top: 80px;
  bottom: 16px;
  width: 160px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  padding: 10px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.08);
  z-index: 10;
}

.side-strip-left { left: 12px; }
.side-strip-right { right: 12px; }

.side-rail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.side-rail img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
}

.portrait-wrap img {
  width: 100%;
  max-height: 20vh;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
}

.audio-wrap {
  margin-top: 10px;
}

.audio-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
  word-break: break-all;
}

.audio-wrap audio {
  width: 100%;
}

.has-media-strips .content {
  padding-left: 190px;
  padding-right: 210px;
}

@media (max-width: 1080px) {
  .side-strip {
    display: none;
  }
  .has-media-strips .content {
    padding-left: 18px;
    padding-right: 18px;
  }
}

