

.mmv, .mmv *, .mmv *::before, .mmv *::after, .mmv-pl, .mmv-pl *, .mmv-pl *::before, .mmv-pl *::after { box-sizing: border-box; }
.mmv [hidden], .mmv-pl [hidden] { display: none !important; }


.mmv { display: grid; gap: 12px; min-width: 0; align-content: start; }
.mmv-head { display: grid; gap: 4px; min-width: 0; }
.mmv-head h1 { overflow-wrap: anywhere; }
.mmv-sub { margin: 0; color: var(--soft); font-size: 14px; max-width: 62ch; overflow-wrap: anywhere; }
.mmv-filter { display: flex; gap: 8px; flex-wrap: wrap; }
.mmv-filter .chip { min-height: 40px; }

.mmv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; min-width: 0; }
@media (min-width: 640px) { .mmv-grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); } }

.mmv-card {
  display: grid; gap: 8px; min-width: 0; padding: 8px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--text);
  font: 400 14px/1.3 var(--font-text);
}
.mmv-card:hover { border-color: var(--accent-text); }
.mmv-card:focus-visible, .mmv-btn:focus-visible, .mmv-x:focus-visible, .mmv-nav:focus-visible, .mmv-entry:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }

.mmv-thumb {
  position: relative; display: block; width: 100%; aspect-ratio: 4 / 5; overflow: hidden;
  border: 1px solid var(--line-soft); border-radius: 10px; background: var(--icon-bg);
}
.mmv-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--surface); }
.mmv-thumb.is-bare img { display: none; }
.mmv-play {
  position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--accent-text);
}
.mmv-play svg { width: 18px; height: 18px; fill: currentColor; margin-left: 2px; }
.mmv-tag {
  position: absolute; left: 6px; top: 6px; max-width: calc(100% - 12px); padding: 3px 8px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: 500 11px/1.2 var(--font-mono); letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mmv-dur {
  position: absolute; right: 6px; bottom: 6px; padding: 3px 7px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 500 11px/1.2 var(--font-mono);
}
.mmv-title { display: block; min-width: 0; font-weight: 500; font-size: 14px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mmv-meta { display: flex; flex-wrap: wrap; gap: 2px 8px; min-width: 0; color: var(--soft); font-size: 12.5px; line-height: 1.35; }
.mmv-left.is-soon, .mmv-keep.is-soon { color: var(--accent-text); font-weight: 500; }

.mmv-empty {
  display: grid; justify-items: start; gap: 10px; padding: 16px; border: 1px dashed var(--line); border-radius: var(--r-lg);
  background: var(--surface); color: var(--text);
}
.mmv-empty b { font: 500 16px/1.3 var(--font-head); }
.mmv-empty p { margin: 0; color: var(--soft); font-size: 14px; max-width: 56ch; }
.mmv-empty .cta { text-decoration: none; }
.mmv-note { margin: 0; color: var(--soft); font-size: 13px; }
.mmv .notice { margin: 0; }


.mmv-entry { text-decoration: none; }


.mmv-pl {
  position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; min-height: 0;
  background: var(--bg); color: var(--text); font: 400 14px/1.4 var(--font-text);
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}
html.mmv-lock, html.mmv-lock body { overflow: hidden; }
.mmv-pl-bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); min-width: 0; }
.mmv-pl-count { flex: none; color: var(--soft); font: 500 12px/1 var(--font-mono); }
.mmv-pl-t { flex: 1; min-width: 0; margin: 0; font: 500 14px/1.3 var(--font-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mmv-x {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text);
}
.mmv-x svg, .mmv-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.mmv-pl-main { flex: 1; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 12px; padding: 12px 16px 16px; }
.mmv-pl-stage { display: flex; align-items: center; justify-content: center; gap: 12px; min-width: 0; touch-action: pan-y; }
.mmv-frame {
  position: relative; flex: 0 1 auto; min-width: 0; max-width: 100%; overflow: hidden;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.mmv-frame[data-fmt="9:16"] { aspect-ratio: 9 / 16; height: min(66dvh, 72vh, 760px); }
.mmv-frame[data-fmt="1:1"] { aspect-ratio: 1 / 1; height: min(56dvh, 560px); max-width: 100%; }
.mmv-frame[data-fmt="16:9"] { aspect-ratio: 16 / 9; width: min(100%, 960px); height: auto; }
.mmv-frame video { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--surface); }
.mmv-nav {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; cursor: pointer;
  border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--text);
}
.mmv-nav:disabled { opacity: .35; cursor: default; }

.mmv-pl-info { display: grid; gap: 4px; justify-items: center; text-align: center; min-width: 0; }
.mmv-pl-info .mmv-pl-name { margin: 0; font: 500 16px/1.3 var(--font-head); overflow-wrap: anywhere; }
.mmv-pl-info p { margin: 0; color: var(--soft); font-size: 13px; overflow-wrap: anywhere; }
.mmv-pl-act { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.mmv-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; min-width: 0;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text);
  font: 500 14px/1.2 var(--font-text); text-decoration: none; text-align: center; cursor: pointer;
}
.mmv-btn.is-main { border-color: var(--accent); background: var(--accent); color:var(--on-accent); }
.mmv-pl-status { margin: 0; min-height: 18px; text-align: center; color: var(--soft); font-size: 13px; overflow-wrap: anywhere; }
.mmv-pl-status.is-bad { color: var(--bad); }
.mmv-copy { width: min(100%, 460px); min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: 400 14px/1.2 var(--font-mono); justify-self: center; }

@media (max-width: 639px) {
  .mmv-pl-main { padding: 12px 16px 16px; }
  .mmv-nav { display: none; }        
  .mmv-frame[data-fmt="9:16"] { height: min(62dvh, 70vh); max-width: 100%; }
  .mmv-pl-act { display: grid; grid-template-columns: 1fr; }
  .mmv-pl-act .mmv-btn { width: 100%; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .mmv-frame[data-fmt="9:16"] { height: 78dvh; }
  .mmv-frame[data-fmt="1:1"] { height: 70dvh; }
  .mmv-frame[data-fmt="16:9"] { width: min(100%, 62vw); }
}
@media (prefers-reduced-motion: reduce) { .mmv *, .mmv-pl * { transition: none !important; animation: none !important; } }
