.mred {
  --ed-orange: #ff5629;
  --ed-orange-dark: #e8461e;
  --ed-aqua: #008b94;
  --ed-ink: #142b45;
  --ed-muted: #64758a;
  --ed-line: #e9edf1;
  --ed-bg: #f6f8fa;
  --ed-radius: 17px;
  --ed-shadow: 0 1px 2px rgba(20, 43, 69, .04), 0 6px 20px rgba(20, 43, 69, .05);
  background: var(--ed-bg);
  color: var(--ed-ink);
  font-family: var(--mr-font-sans);
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.mred *, .mred *::before, .mred *::after { box-sizing: border-box; }
.mred :where(a) { color: inherit; text-decoration: none; }
.mred :where(h1, h2, p, dl, dd) { margin: 0; }
.mred :where(strong, b) { font-weight: 700; }
.mred :focus-visible { outline: 2px solid var(--ed-aqua); outline-offset: 3px; }
.mred .mred-icon { display: block; flex: none; }
.mred .mred-wrap { width: min(1240px, calc(100% - 32px)); margin-inline: auto; padding: 16px 0 56px; }
.mred .mred-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 7px;
  margin-bottom: 10px;
  color: var(--ed-muted);
  font-size: 12px;
}
.mred .mred-breadcrumb a { display: inline-flex; align-items: center; min-height: 32px; font-weight: 600; }

.mred .mred-card {
  min-width: 0;
  border: 1px solid var(--ed-line);
  border-radius: var(--ed-radius);
  background: #fff;
  box-shadow: var(--ed-shadow);
  scroll-margin-top: 100px;
}
.mred .mred-hero {
  display: grid;
  grid-template-columns: minmax(0, clamp(180px, 18vw, 230px)) minmax(0, 1fr);
  align-items: start;
  gap: 20px;
  padding: 14px;
  background: linear-gradient(115deg, #fff 55%, #fff6f1);
}
.mred .mred-poster {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 6 / 7;
  max-height: 290px;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(145deg, #e6f6f7, #f6f8fa 60%, #fff1eb);
  color: var(--ed-aqua);
}
.mred .mred-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mred .mred-copy { align-self: center; display: grid; gap: 12px; min-width: 0; padding: 8px 8px 8px 0; }
.mred .mred-title { color: var(--ed-ink); font-size: clamp(22px, 1.8vw, 26px); font-weight: 700; line-height: 1.15; letter-spacing: -.02em; }
.mred .mred-summary { max-width: 66ch; color: var(--ed-muted); }
.mred .mred-chips, .mred .mred-actions, .mred .mred-artists, .mred .mred-row-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.mred .mred-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ed-bg);
  color: var(--ed-ink);
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
}
.mred .mred-chip-accent { background: #fff1eb; color: #9f391e; }
.mred .mred-facts, .mred .mred-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.mred .mred-facts { grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); }
.mred .mred-facts > div, .mred .mred-info-item {
  padding: 9px 11px;
  border: 1px solid var(--ed-line);
  border-radius: 10px;
  background: var(--ed-bg);
}
.mred .mred-facts dt { display: flex; align-items: center; gap: 6px; color: var(--ed-muted); font-size: 12px; }
.mred .mred-facts dt .mred-icon { color: var(--ed-aqua); }
.mred .mred-facts dd, .mred .mred-info-item strong { display: block; margin-top: 3px; font-size: 13px; font-weight: 700; }
.mred .mred-info-item span { display: block; color: var(--ed-muted); font-size: 12px; }

.mred .mred-btn, .mred .mred-side-action.disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--ed-ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}
.mred .mred-btn { transition: transform 100ms ease-out, background-color 160ms ease-out, border-color 160ms ease-out; touch-action: manipulation; }
.mred .mred-btn:active { transform: scale(.97); }
.mred .mred-btn-primary { background: var(--ed-orange); }
.mred .mred-btn-soft { background: #e6f6f7; color: #00636b; }
.mred .mred-btn-outline { background: #fff; border-color: var(--ed-line); }
.mred .mred-side-action { width: 100%; margin-top: 10px; }
.mred .mred-side-action.disabled { background: var(--ed-bg); color: var(--ed-muted); }

.mred .mred-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  align-items: start;
  gap: 16px;
  margin-top: 16px;
}
.mred .mred-main, .mred .mred-side { display: grid; gap: 16px; min-width: 0; }
.mred .mred-content, .mred .mred-side-card, .mred .mred-list-head, .mred .mred-empty { padding: 18px; }
.mred .mred-section-head { margin-bottom: 12px; }
.mred .mred-card h2 { color: var(--ed-ink); font-size: 18px; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; }
.mred .mred-section-head p, .mred .mred-list-head p, .mred .mred-side-card > p {
  margin-top: 4px;
  color: var(--ed-muted);
  font-size: 12px;
}
.mred .mred-content-text { white-space: pre-line; }
.mred .mred-full-summary + .mred-content-text { margin-top: 8px; }
.mred .mred-artists { margin-top: 12px; }
.mred .mred-artist {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid var(--ed-line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
.mred .mred-artist img { width: 26px; height: 26px; flex: none; border-radius: 50%; object-fit: cover; }
.mred .mred-solution h2 { display: flex; align-items: center; gap: 8px; }
.mred .mred-solution h2 .mred-icon { color: var(--ed-aqua); }

.mred .mred-related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mred .mred-related, .mred .mred-quick-links a {
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--ed-line);
  border-radius: 10px;
  background: var(--ed-bg);
  font-size: 13px;
}
.mred .mred-related em { color: #9f391e; font-size: 12px; font-style: normal; font-weight: 600; }
.mred .mred-related span, .mred .mred-quick-links strong + span { color: var(--ed-muted); font-size: 12px; }
.mred .mred-quick-links { display: grid; gap: 7px; margin-top: 10px; }
.mred .mred-quick-links a:has(> .mred-icon) { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }

.mred .mred-ticket-card { border-color: #f4d8cb; background: linear-gradient(155deg, #fff 65%, #fff6f1); }
.mred .mred-ticket-status, .mred .mred-ticket-row-top, .mred .mred-source {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}
.mred .mred-ticket-status { margin-top: 12px; }
.mred .mred-ticket-status span, .mred .mred-source span { color: var(--ed-muted); }
.mred .mred-ticket-status strong { color: #00636b; }
.mred .mred-ticket-status .closed { color: #a13420; }
.mred .mred-ticket-list { display: grid; gap: 8px; margin-top: 10px; }
.mred .mred-ticket-row { padding: 10px; border: 1px solid var(--ed-line); border-radius: 10px; background: #fff; }
.mred .mred-ticket-row b { color: #9f391e; text-align: end; }
.mred .mred-ticket-row p { margin-top: 4px; color: var(--ed-muted); font-size: 12px; }
.mred .mred-ticket-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.mred .mred-ticket-meta span { margin-top: 5px; padding: 3px 7px; border-radius: 999px; background: var(--ed-bg); }
.mred .mred-native-note { margin-top: 10px; padding: 9px 11px; border-radius: 10px; background: #fff1eb; color: #803d29; font-size: 12px; }
.mred .mred-source { padding: 8px 0; border-bottom: 1px solid var(--ed-line); }
.mred .mred-source:last-child { padding-bottom: 0; border-bottom: 0; }
.mred .mred-source strong { text-align: end; }

.mred .mred-list-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.mred .mred-list-head .mred-chip { flex-shrink: 0; }
.mred .mred-date-row {
  display: grid;
  grid-template-columns: minmax(96px, .75fr) minmax(0, 1fr) minmax(0, 1.2fr);
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid var(--ed-line);
  font-size: 13px;
}
.mred .mred-date { color: #9f391e; font-weight: 700; }
.mred .mred-date small, .mred .mred-place > span { display: block; color: var(--ed-muted); font-size: 12px; font-weight: 400; }
.mred .mred-place .mred-chip { margin-top: 4px; }
.mred .mred-row-actions { justify-content: flex-end; }
.mred .mred-empty { padding-top: 0; color: var(--ed-muted); }
.mred .mred-mobile-bar { display: none; }

@media (hover: hover) and (pointer: fine) {
  .mred .mred-btn-primary:hover { background: var(--ed-orange-dark); color: #101e30; }
  .mred .mred-btn-soft:hover { background: #d4eff1; }
  .mred .mred-btn-outline:hover, .mred .mred-artist:hover, .mred .mred-related:hover, .mred .mred-quick-links a:hover {
    border-color: #ffc6b2;
    background: #fff1eb;
  }
  .mred .mred-breadcrumb a:hover, .mred a.mred-chip:hover { text-decoration: underline; }
}

@media (max-width: 860px) {
  .mred .mred-wrap { width: calc(100% - 24px); padding-top: 8px; }
  .mred .mred-hero, .mred .mred-layout { grid-template-columns: minmax(0, 1fr); }
  .mred .mred-hero { gap: 12px; padding: 10px; }
  .mred .mred-poster { aspect-ratio: 16 / 10; max-height: 220px; }
  .mred .mred-copy { padding: 4px 6px 6px; }
  .mred .mred-title { font-size: 21px; }
  .mred .mred-facts, .mred .mred-info-grid, .mred .mred-related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mred .mred-facts > :first-child { grid-column: 1 / -1; }
  .mred .mred-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .mred .mred-breadcrumb a, .mred a.mred-chip { min-height: 44px; }
  .mred .mred-mobile-bar {
    position: sticky;
    z-index: 10;
    bottom: calc(68px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-top: 1px solid var(--ed-line);
    background: #fff;
    box-shadow: 0 -1px 12px rgba(20, 43, 69, .06);
  }
  .mred .mred-mobile-bar span, .mred .mred-mobile-bar strong { display: block; font-size: 12px; }
  .mred .mred-mobile-bar span { color: var(--ed-muted); }
}

@media (max-width: 520px) {
  .mred .mred-title { font-size: 20px; }
  .mred .mred-content, .mred .mred-side-card, .mred .mred-list-head { padding: 14px; }
  .mred .mred-related-grid, .mred .mred-date-row { grid-template-columns: minmax(0, 1fr); }
  .mred .mred-date-row { gap: 6px; padding: 12px 14px; }
  .mred .mred-row-actions { justify-content: flex-start; }
  .mred .mred-row-actions .mred-btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .mred .mred-btn { transition: none; }
  .mred .mred-btn:active { transform: none; }
}
