/* Media Manager styles. High contrast, visible focus, no information by colour alone. */
:root {
  --bg: #ffffff; --fg: #1a1a1a; --muted: #4a4a4a; --line: #8a8a8a; --soft: #f2f4f7;
  --accent: #0b5cad; --accent-fg: #ffffff; --focus: #c2410c; --ok: #116b2b; --warn: #8a5300; --err: #b3261e;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121417; --fg: #f1f1f1; --muted: #c4c4c4; --line: #8f8f8f; --soft: #1f242b;
          --accent: #7fb8ff; --accent-fg: #0b1220; --focus: #ffb366; --ok: #6fd48a; --warn: #ffcc66; --err: #ff8a80; }
}
* { box-sizing: border-box; }
html { font-size: 100%; }
body { margin: 0; font-family: "Segoe UI", system-ui, sans-serif; line-height: 1.5; background: var(--bg); color: var(--fg); }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.pm-skip { position: absolute; left: -10000px; top: 0; background: var(--accent); color: var(--accent-fg); padding: .5rem 1rem; z-index: 100; }
.pm-skip:focus { left: .5rem; }
.pm-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
header.pm-banner { background: var(--soft); border-bottom: 1px solid var(--line); padding: .5rem 1rem; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; }
.pm-appname { font-weight: 700; font-size: 1.15rem; color: var(--fg); text-decoration: none; }
nav.pm-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem .9rem; }
nav.pm-nav a[aria-current="page"] { font-weight: 700; text-decoration-thickness: 3px; }
form.pm-search { display: flex; gap: .4rem; margin-left: auto; }
main { padding: 1rem 1.25rem 3rem; max-width: 110rem; }
footer.pm-footer { border-top: 1px solid var(--line); padding: .75rem 1.25rem; color: var(--muted); font-size: .9rem; }
h1 { font-size: 1.6rem; margin: .4rem 0 .8rem; }
h2 { font-size: 1.3rem; margin: 1.4rem 0 .6rem; }
h3 { font-size: 1.1rem; margin: 1.1rem 0 .5rem; }
nav.pm-breadcrumb ol { list-style: none; padding: 0; margin: 0 0 .3rem; display: flex; flex-wrap: wrap; }
nav.pm-breadcrumb li + li { margin-left: .6rem; padding-left: .6rem; border-left: 1px solid var(--muted); }
button, .pm-button, input[type=submit] {
  font: inherit; padding: .35rem .8rem; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-fg);
  border-radius: 4px; cursor: pointer; text-decoration: none; display: inline-block; line-height: 1.4;
}
button.pm-secondary, .pm-button.pm-secondary { background: var(--bg); color: var(--accent); }
button.pm-danger { background: #a31b14; border-color: #a31b14; color: #fff; }
button[aria-disabled="true"] { opacity: .65; }
button.pm-sort { background: none; border: none; color: inherit; font-weight: 700; padding: 0; text-decoration: underline; }
th[aria-sort="ascending"] .pm-sort::after { content: "";display:inline-block;margin-left:.4em;border-left:.3em solid transparent;border-right:.3em solid transparent;border-bottom:.4em solid currentColor; }
th[aria-sort="descending"] .pm-sort::after { content: "";display:inline-block;margin-left:.4em;border-left:.3em solid transparent;border-right:.3em solid transparent;border-top:.4em solid currentColor; }
input, select, textarea { font: inherit; padding: .3rem .45rem; border: 1px solid var(--line); border-radius: 3px; background: var(--bg); color: var(--fg); max-width: 100%; }
textarea { width: 100%; min-height: 6rem; }
label { font-weight: 600; }
.pm-field { margin: .6rem 0; }
.pm-field label, .pm-field .pm-label { display: block; }
/* A checkbox or radio sits on the same line as its label, aligned with it. */
.pm-field input[type=checkbox] + label, .pm-field input[type=radio] + label { display: inline; }
input[type=checkbox], input[type=radio] { vertical-align: middle; margin: 0 .35rem 0 0; width: 1.1rem; height: 1.1rem; }
.pm-field-inline { display: inline-flex; gap: .4rem; align-items: center; margin-right: 1rem; }
.pm-hint { color: var(--muted); font-size: .92rem; margin: .15rem 0; }
.pm-error-text { color: var(--err); font-weight: 600; }
fieldset { border: 1px solid var(--line); padding: .6rem .9rem; margin: .8rem 0; }
legend { font-weight: 700; padding: 0 .3rem; }
table { border-collapse: collapse; width: 100%; margin: .5rem 0 1rem; }
caption { text-align: left; font-weight: 700; padding: .3rem 0; }
th, td { border-bottom: 1px solid var(--line); padding: .35rem .5rem; text-align: left; vertical-align: top; }
th { background: var(--soft); }
td.pm-num, th.pm-num { text-align: right; font-variant-numeric: tabular-nums; }
.pm-thumb { width: 72px; height: 72px; object-fit: cover; background: var(--soft); display: block; }
.pm-actions-cell { white-space: nowrap; }
.pm-menu-wrap { position: relative; display: inline-block; }
[role="menu"] { position: absolute; z-index: 50; min-width: 15rem; max-width: 24rem; list-style: none; margin: .15rem 0 0; padding: .25rem 0;
  background: var(--bg); border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(0,0,0,.25); left: 0; top: 100%; }
[role="menu"].pm-menu-left { left: auto; right: 0; }
[role="menu"].pm-menu-up { top: auto; bottom: 100%; }
[role="menu"] li { margin: 0; }
[role="menuitem"] { display: block; width: 100%; text-align: left; background: none; color: var(--fg); border: none; border-radius: 0; padding: .4rem .9rem; text-decoration: none; }
[role="menuitem"]:hover, [role="menuitem"]:focus { background: var(--accent); color: var(--accent-fg); outline: none; }
[role="separator"] { border-top: 1px solid var(--line); margin: .25rem 0; }
[role="tablist"] { display: flex; flex-wrap: wrap; gap: .2rem; border-bottom: 2px solid var(--line); margin: 1rem 0 0; }
[role="tab"] { background: var(--soft); color: var(--fg); border: 1px solid var(--line); border-bottom: none; border-radius: 4px 4px 0 0; }
[role="tab"][aria-selected="true"] { background: var(--accent); color: var(--accent-fg); font-weight: 700; }
[role="tabpanel"] { padding: .5rem 0; }
dialog { border: 2px solid var(--line); border-radius: 6px; padding: 0; max-width: min(46rem, 95vw); width: 100%; background: var(--bg); color: var(--fg); }
dialog::backdrop { background: rgba(0,0,0,.5); }
.pm-dialog-head { display: flex; justify-content: space-between; align-items: center; padding: .6rem 1rem; border-bottom: 1px solid var(--line); background: var(--soft); }
.pm-dialog-head h2 { margin: 0; font-size: 1.2rem; }
.pm-dialog-body { padding: .6rem 1rem; max-height: 70vh; overflow: auto; }
.pm-dialog-foot { padding: .6rem 1rem; border-top: 1px solid var(--line); display: flex; gap: .6rem; flex-wrap: wrap; }
.pm-flash { border: 2px solid var(--ok); padding: .5rem .8rem; margin: .5rem 0; background: var(--soft); }
.pm-flash-error { border-color: var(--err); }
/* 2.6.0: completion notices (pm.js showToast): fixed at the lower right, never covering the focused control's row. */
.pm-toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 60; display: flex; flex-direction: column; gap: .5rem; max-width: min(28rem, calc(100vw - 2rem)); }
.pm-toast { border: 2px solid var(--ok); background: var(--bg, #fff); color: inherit; padding: .5rem .75rem; box-shadow: 0 .2rem .6rem rgba(0,0,0,.25); display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.pm-toast p { margin: 0; flex: 1 1 100%; }
.pm-toast-error { border-color: var(--err); }
.pm-play-provide { margin: .5rem 0; }
.pm-flash-warning { border-color: var(--warn); }
.pm-badge { display: inline-block; border: 1px solid var(--line); border-radius: 3px; padding: 0 .35rem; font-size: .85rem; }
.pm-badge-warn { border-color: var(--warn); color: var(--warn); }
.pm-badge-err { border-color: var(--err); color: var(--err); }
.pm-selection-bar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding: .4rem .6rem; border: 1px solid var(--line); background: var(--soft); margin: .5rem 0; }
.pm-filter-panel { border: 1px solid var(--line); padding: .6rem 1rem; margin: .5rem 0; background: var(--soft); }
.pm-filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .3rem 1rem; }
.pm-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 1rem; }
.pm-card { border: 1px solid var(--line); padding: .4rem; display: flex; flex-direction: column; gap: .3rem; }
.pm-card img { width: 100%; height: 11rem; object-fit: cover; background: var(--soft); }
.pm-pager ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem .8rem; align-items: center; }
.pm-media-view img.pm-full { max-width: 100%; max-height: 80vh; height: auto; }
.pm-media-view video { max-width: 100%; max-height: 70vh; }
.pm-transcript ol { padding-left: 0; list-style: none; }
.pm-transcript li { margin: .2rem 0; }
.pm-transcript button { background: var(--bg); color: var(--accent); text-align: left; }
.pm-text-item { border-left: 4px solid var(--line); padding: .3rem .8rem; margin: .7rem 0; }
.pm-text-item.pm-ai { border-left-color: var(--warn); }
dl.pm-facts { display: grid; grid-template-columns: max-content 1fr; gap: .2rem 1rem; }
dl.pm-facts dt { font-weight: 700; }
dl.pm-facts dd { margin: 0; }
.pm-row-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
[dir="rtl"] { text-align: right; }

[hidden] { display: none !important; }
.pm-command-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1rem; margin: .75rem 0; }
form.pm-search { flex: 1 1 32rem; max-width: 55rem; }
.pm-search input { min-width: 8rem; width: 100%; }
main { max-width: none; }
th, td { padding: .6rem .5rem; overflow-wrap: normal; }
td:has(time), td.pm-num, .pm-date-widget { white-space: nowrap; }
button:disabled { opacity: .6; cursor: default; }
.pm-actions-cell { white-space: normal; }
[role="menu"] { max-width: min(24rem, 95vw); max-height: 80vh; overflow-y: auto; }
[role="menuitem"] { white-space: normal; }
[role="menuitem"]:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
@media (max-width: 60rem) {
  .pm-search { margin-left: 0; }
  th, td { padding: .45rem; }
  table { display: block; overflow-x: auto; }
  dl.pm-facts { grid-template-columns: minmax(6rem, 1fr) minmax(0, 2fr); }
}

.able-modal-header h2 { font-size: 1.2rem; margin: 0; }

table[data-sort-url] tbody th[scope="row"], td[dir="auto"] { overflow-wrap: anywhere; }
table[data-sort-url] tbody th[scope="row"] { min-width: 8rem; max-width: 24rem; }
.pm-actions-cell button, #selection-button { white-space: nowrap; overflow-wrap: normal; }

button.pm-link { border: 0; padding: 0; background: none; color: var(--accent); text-decoration: underline; text-align: left; }
#pm-remote { max-width: min(90rem,96vw); }
.pm-compare-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(22rem,100%),1fr)); gap: 1rem; }
.pm-compare-card { border: 1px solid var(--line); padding: .8rem; min-width: 0; }
.pm-compare-card img,.pm-compare-card video { max-width: 100%; max-height: 26rem; object-fit: contain; }

body[data-theme="light"] { --bg:#fff;--fg:#1a1a1a;--muted:#4a4a4a;--line:#8a8a8a;--soft:#f2f4f7;--accent:#0b5cad;--accent-fg:#fff;--focus:#c2410c;--ok:#116b2b;--warn:#8a5300;--err:#b3261e; }
body[data-theme="dark"] { --bg:#121417;--fg:#f1f1f1;--muted:#c4c4c4;--line:#8f8f8f;--soft:#1f242b;--accent:#7fb8ff;--accent-fg:#0b1220;--focus:#ffb366;--ok:#6fd48a;--warn:#ffcc66;--err:#ff8a80; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }

.pm-search {position:relative}
#global-suggestions {position:absolute;top:100%;left:0;right:0;z-index:2000;list-style:none;margin:0;padding:.3rem;max-height:60vh;overflow:auto;background:var(--bg);color:var(--fg);border:2px solid currentColor;box-shadow:0 4px 10px #0005}
#global-suggestions[hidden]{display:none}
#global-suggestions [role=option]{padding:.65rem;overflow-wrap:anywhere;cursor:pointer;border-bottom:1px solid #8886}
#global-suggestions [aria-selected=true]{outline:3px solid currentColor;outline-offset:-3px;background:var(--soft)}
.pm-search-reason{display:block;font-size:.9em}
.pm-command-bar{gap:.65rem;align-items:center}

/* Single-record properties retain native table/row-header semantics at every width. */
table.pm-properties{width:100%;table-layout:fixed}
.pm-properties th[scope=row]{width:30%;vertical-align:top;white-space:normal}
.pm-properties td{white-space:normal;overflow-wrap:anywhere;vertical-align:top}

.able-controller .pm-player-primary,.able-controller .pm-player-secondary .pm-command-bar{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem;margin:.4rem 0}
.able-controller .pm-player-primary{position:relative}
.able-controller .pm-player-primary button{color:var(--fg);background:var(--bg);font:inherit;border:1px solid var(--line)}
.able-controller .pm-player-secondary[hidden]{display:none!important}
.able-controller .able-volume-slider{z-index:4}
.able-wrapper video{max-width:100%;height:auto}

/* Viewer layout controls never hide the navigation/restore commands. */
#viewer-orientation { margin:.4rem 0 .8rem; overflow-wrap:anywhere; }
#viewer-details[hidden] { display:none !important; }
[data-shortcut-capture] { width:min(100%,25rem); cursor:pointer; }
[data-shortcut-capture][data-capturing="true"] { outline:3px solid var(--focus); outline-offset:2px; }
.pm-media-max main { max-width:none; padding:.5rem; }
.pm-media-max main > h1 { font-size:1.05rem; margin:0 0 .25rem; }
.pm-media-max #viewer-orientation { margin:.25rem 0; }
.pm-media-max .pm-media-view { margin:.25rem 0; }
.pm-media-max .pm-full,.pm-media-max video { max-height:calc(100dvh - 12rem); width:auto; max-width:100%; object-fit:contain; }
.pm-media-max .able-wrapper { max-width:100%; }
body[data-viewer-mode="window"] main { padding:.5rem; }
[data-location-field="progress"] { display:block; }

/* ---- Phase 1 normalization (1.0.6) ---- */
/* Toggle buttons: off = outlined, on = filled with a drawn check mark (no text content, so nothing extra is spoken). */
button[aria-pressed="false"] { background: var(--bg); color: var(--accent); }
button[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); font-weight: 700; box-shadow: inset 0 -3px 0 var(--fg); }
button[aria-pressed="true"]::before { content: ""; display: inline-block; width: .35em; height: .7em; margin: 0 .45em .1em 0; border: solid currentColor; border-width: 0 .14em .14em 0; transform: rotate(45deg); }
/* Menus float above media players and other content; separators set destructive commands apart. */
.pm-menu-wrap { z-index: auto; }
[role="menu"] { z-index: 3000; }
.pm-menu-wrap:has([aria-expanded="true"]) { z-index: 3000; }
li.pm-menu-sep, [role="menu"] [role="separator"] { border-top: 2px solid var(--line); margin: .35rem .5rem; list-style: none; }
/* Selection count, then Bulk Actions. */
.pm-selection-bar { border: 0; background: none; padding: 0; margin: .5rem 0; }
/* Cards (PM2 card pattern): a list of equal-height cards in a responsive grid, each an article named by its heading. */
.pm-grid-tools { margin: .5rem 0; }
.pm-card-grid { list-style: none; padding: 0; margin: .5rem 0 1.5rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(14rem, 100%), 1fr)); grid-auto-rows: 1fr; gap: .75rem; }
.pm-card-grid > li { display: flex; min-width: 0; }
.pm-card { flex: 1; display: flex; flex-direction: column; gap: .35rem; border: 1px solid var(--line); border-radius: .45rem; padding: .6rem; min-width: 0; background: var(--bg); }
.pm-card-media { display: block; width: 100%; aspect-ratio: 4 / 3; height: auto; object-fit: cover; background: var(--soft); border-radius: .3rem; }
.pm-card-icon { display: flex; align-items: center; justify-content: center; font-size: 3rem; color: var(--muted); }
.pm-card-title { font-size: 1.02rem; line-height: 1.3; margin: .2rem 0 0; overflow-wrap: anywhere; }
.pm-card-meta { margin: 0; color: var(--muted); font-size: .92rem; }
.pm-card-meta .pm-badge { margin-right: .3rem; }
.pm-card-actions { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding-top: .35rem; }
.pm-card-actions label { font-weight: 400; }
/* Pager: Previous | 26–50 of 600 | Next */
.pm-pager { display: flex; justify-content: center; align-items: center; gap: .5rem; margin: 1rem 0; flex-wrap: wrap; }
.pm-pager-range { min-width: 10rem; font-variant-numeric: tabular-nums; }
dialog.pm-dialog-small { max-width: min(24rem, 95vw); }
/* Dialogs: one scroll area at most; choices list stays compact. */
.pm-dialog-body { max-height: 65vh; }
.pm-choices { max-height: 16rem; overflow: auto; margin: .4rem 0; }
.pm-choices > div { padding: .15rem 0; }
.pm-choices label { font-weight: 400; }
/* Transcript: readable in light and dark themes (Able Player paints a white panel). */
.able-transcript-area, .able-transcript, .able-transcript-container, .able-window-toolbar { background: var(--bg) !important; color: var(--fg) !important; }
.able-transcript .able-transcript-seekpoint, .able-transcript span { color: var(--fg); }
.able-transcript .able-highlight { background: var(--accent) !important; color: var(--accent-fg) !important; }
.pm-transcript button, .pm-transcript li { color: var(--fg); }
.pm-transcript li[aria-current="true"] { background: var(--soft); outline: 2px solid var(--accent); }
/* Able Player uses z-index 5000–9500 internally; isolate it so open menus always appear above the player. */
.pm-media-view, .pm-compare-card, .able-wrapper { position: relative; z-index: 0; isolation: isolate; }
.pm-menu-wrap { position: relative; }
.pm-menu-wrap:has(> [aria-expanded="true"]) { z-index: 3000; }

/* 1.0.7 player: one wrapping row of standard controls in reading order. */
.pm-player { max-width: none; }
.pm-player video { display: block; max-width: min(100%, 960px); height: auto; }
.pm-player audio { display: none; }
.pm-player-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin: .5rem 0; }
.pm-player-field { display: inline-flex; align-items: center; gap: .35rem; }
.pm-player-volume input { width: 6rem; }
.pm-player-seek { flex: 0 1 14rem; }
.pm-player-seek input { flex: 1 1 auto; min-width: 8rem; }
.pm-player-time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pm-player input[type=range] { accent-color: var(--accent, #1a5fb4); min-height: 1.5rem; }
.pm-caption-line { min-height: 1.6em; padding: .4rem .6rem; background: #000; color: #fff; border-radius: 4px; font-size: 1.15rem; }
.pm-caption-line:empty { display: none; }
.pm-cap-small video::cue, .pm-cap-small .pm-caption-line { font-size: 90%; }
.pm-cap-large video::cue, .pm-cap-large .pm-caption-line { font-size: 140%; }
.pm-cap-xlarge video::cue, .pm-cap-xlarge .pm-caption-line { font-size: 180%; }
.pm-player:fullscreen { background: #000; color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 1rem; max-width: none; }
.pm-player:fullscreen video { max-height: calc(100vh - 6rem); max-width: 100%; margin: 0 auto; }
.pm-player-transcript { border: 1px solid var(--border, #888); border-radius: 4px; padding: .5rem; margin: .5rem 0; max-width: 960px; }
.pm-player-lines { max-height: 16rem; overflow-y: auto; position: relative; }
.pm-player-lines ol { margin: 0; padding-left: 1.5rem; }
.pm-player-lines li[aria-current="true"] { background: var(--highlight-bg, #fff3b0); color: var(--highlight-fg, #000); outline: 2px solid currentColor; }
/* Details: Media Actions on the left, tablist on the right; reading order is the same. */
.pm-details-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .75rem; }
.pm-details-bar [role=tablist] { margin-left: auto; }
.pm-inline { display: inline; }

.pm-viewer-desc { max-width: 960px; margin: .5rem 0; }
.pm-viewer-desc p { margin: .35rem 0; white-space: pre-line; }

/* Phase 2: section links (Activity, Admin), inline forms, spam trap, review and share pages */
.pm-sectionnav ul { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; padding: 0; margin: 0 0 1rem; }
.pm-sectionnav a[aria-current="page"] { font-weight: 700; text-decoration: none; }
.pm-inline { display: inline; }
.pm-position { padding: 0 .5rem; align-self: center; }
.pm-honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.pm-comment { border-top: 1px solid var(--line); padding: .4rem 0; }
.pm-comment h3 { font-size: 1rem; margin: 0; }

/* Dashboard statistic cards */
.pm-stat-grid { grid-template-columns: repeat(auto-fill, minmax(min(11rem, 100%), 1fr)); grid-auto-rows: auto; }
.pm-stat-value { font-size: 1.8rem; font-weight: 700; margin: 0; }
.pm-review-card { margin: 0 0 1rem; max-width: 60rem; }
.pm-review-thumb { max-width: 16rem; }
.pm-inline-fieldset { display: flex; gap: 1rem; align-items: center; border: 0; padding: 0; margin: .5rem 0; }
.pm-inline-fieldset legend { float: left; margin-right: .75rem; font-weight: 600; }
.pm-command-row { display: flex; gap: .5rem; margin: .5rem 0; }
#transfer-table progress { width: 8rem; }

/* Playback 2.5.0: media fills the window; browsing controls above, player controls below stay visible. */
.pm-play-bar{position:sticky;top:0;z-index:2;background:var(--bg,Canvas);flex-wrap:wrap}
.pm-play-stage .pm-full,.pm-play-stage video{display:block;max-width:100%;max-height:calc(100vh - 15rem);width:auto;height:auto;margin:0 auto}
.pm-play-stage audio{width:100%}
.pm-play-browse .pm-card-grid{max-height:40vh;overflow:auto}
.pm-inline-fieldset{border:0;padding:0;margin:0 0 .5rem}

/* Playback 2.5.1: compact header and controls, large media, collection grid. */
main:has(#pm-play) #main-heading{font-size:1.15rem;margin:.15rem 0 .35rem}
.pm-play-browse{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem 1rem;margin:0 0 .35rem}
.pm-play-browse .pm-inline-fieldset{margin:0;display:flex;gap:.35rem;align-items:center}
.pm-play-browse .pm-inline-fieldset legend{float:left;margin-right:.35rem;padding:0}
.pm-play-filters{display:inline-flex;flex-wrap:wrap;align-items:center;gap:.25rem .75rem}
.pm-play-filters .pm-field{margin:0}
.pm-play-stage .pm-play-title{font-size:1.05rem;margin:.1rem 0 .3rem}
.pm-play-stage .pm-media-view{margin:0}
.pm-play-stage .pm-full,.pm-play-stage video{max-height:calc(100vh - 13rem)}
.pm-play-detached .pm-play-stage .pm-full,.pm-play-detached .pm-play-stage video{max-height:calc(100vh - 8rem)}
.pm-play-bar{position:sticky;bottom:0;top:auto;margin:.35rem 0}
.pm-play-notice{padding:.75rem;border:2px dashed currentColor;margin:.5rem 0}
.pm-play-subheading{font-size:1rem;margin:.75rem 0 .2rem}
.pm-play-grid{display:block}
.pm-play-row{display:flex;gap:.5rem;margin-bottom:.5rem}
.pm-play-cell{width:160px;box-sizing:border-box;border:2px solid transparent;border-radius:6px;padding:.3rem;cursor:pointer;display:flex;flex-direction:column;align-items:center;text-align:center}
.pm-play-cell img,.pm-play-icon{width:148px;height:100px;object-fit:cover;display:flex;align-items:center;justify-content:center;font-size:2rem;background:rgba(127,127,127,.15)}
.pm-play-cell-title{font-size:.9rem;overflow-wrap:anywhere}
.pm-play-now{display:none;font-size:.8rem;font-weight:700}
.pm-play-current{border-color:currentColor;border-style:solid;background:rgba(127,127,127,.12)}
.pm-play-current .pm-play-now{display:block}
.pm-play-cell:focus{outline:3px dashed Highlight;outline-offset:2px}

/* 2.5.2: previous/next collection, names truncated visually only */
.pm-play-collnav{display:inline-flex;gap:.35rem}
.pm-collnav{max-width:14rem;display:inline-flex;align-items:center;gap:.25rem}
.pm-collnav .pm-trunc{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
@media (max-width:40rem){.pm-collnav{max-width:9rem}}

/* 2.6.1: viewer layout. The media is centered and uses the available width at its own aspect ratio; with Details
   collapsed it may use nearly the whole window height. Smaller margins around the media. */
#pm-viewer .pm-media-view { margin: .25rem 0; }
/* 2.6.2: photos and videos fill the content width (scaled up or down) at their own aspect ratio; the height is limited
   to the window below the navigation bar so the whole picture stays visible. Details stays below the media. */
#pm-viewer .pm-media-view img.pm-full, #pm-viewer .pm-player video { display: block; margin: 0 auto; width: 100%; height: auto;
  max-width: 100%; max-height: calc(100dvh - 15rem); min-height: 12rem; object-fit: contain; background: transparent; }
#pm-viewer .pm-player-controls, #pm-viewer .pm-viewer-desc, #pm-viewer .pm-player-transcript { max-width: none; margin: .3rem 0; }
#pm-viewer .pm-player-controls { justify-content: center; }
#pm-viewer #media-title { margin: .2rem 0 .25rem; font-size: 1.15rem; }
#pm-viewer .pm-commandbar { margin: .25rem 0; }
#viewer-details-toggle { margin: .25rem 0; }
@media (max-width: 40rem) {
  #pm-viewer .pm-media-view img.pm-full, #pm-viewer .pm-player video { max-height: 75dvh; min-height: 0; }
  main { padding: .5rem .75rem 2rem; }
}
/* 2.6.1: Playback. Filters stay one compact group; the player gets the space, its controls directly under it, the
   item grid below; less spacing between them. */
.pm-play-stage .pm-player video, .pm-play-stage .pm-full { display: block; margin: 0 auto; max-width: 100%; width: 100%; height: auto;
  max-height: calc(100dvh - 12rem); object-fit: contain; }
.pm-play-stage .pm-player-controls { justify-content: center; margin: .25rem 0; }
.pm-play-stage .pm-viewer-desc, .pm-play-stage .pm-player-transcript { max-width: none; margin: .25rem 0; }
.pm-play-stage #media-title { font-size: 1.05rem; margin: .1rem 0 .2rem; }
.pm-play-bar { margin: .2rem 0; gap: .35rem .5rem; }
.pm-play-subheading { margin: .4rem 0 .15rem; }
.pm-play-collection .pm-hint { margin: 0 0 .25rem; }
@media (max-width: 40rem) {
  .pm-play-browse { gap: .25rem .5rem; }
  .pm-play-stage .pm-player video, .pm-play-stage .pm-full { max-height: 60dvh; }
  .pm-play-cell { width: 120px; }
  .pm-play-cell img, .pm-play-icon { width: 108px; height: 72px; }
}
/* 2.6.1: Provide Information and Review Suggestions: compact labeled values with their fields. */
.pm-suggest > p:first-of-type { margin: 0 0 .4rem; }
.pm-sg { margin: 0 0 .5rem; }
.pm-sg-cur { margin: .15rem 0; overflow-wrap: anywhere; }
.pm-sg-cur span[dir] { white-space: pre-line; }
.pm-sg-label { font-weight: 700; }
.pm-suggest label { display: block; margin: .15rem 0 .1rem; }
.pm-suggest input:not([type]), .pm-suggest textarea { width: 100%; box-sizing: border-box; }
.pm-suggest label.pm-sg-check, .pm-suggest .pm-inline-fieldset label { display: inline; }
.pm-sg-check { font-size: .95rem; }
.pm-sg-head { font-size: 1rem; margin: .6rem 0 .1rem; }
.pm-sg-facts { margin: 0 0 .4rem; }
.pm-suggest .pm-inline-fieldset { margin: .2rem 0 .4rem; flex-wrap: wrap; gap: .25rem .75rem; }
.pm-desc-facts { margin: .4rem 0; }
.pm-desc-facts dd { white-space: pre-line; overflow-wrap: anywhere; }

/* 2.6.2: compact form dialogs (Share, Provide Information, Review Suggestions): a readable width instead of the wide
   table dialog; fields sized to their content; current values and suggestions kept together. */
#pm-remote.pm-dialog-compact { max-width: min(38rem, 95vw); }
.pm-dialog-compact .pm-field { margin: .35rem 0 .5rem; }
.pm-dialog-compact .pm-field label { display: block; margin-bottom: .1rem; }
.pm-dialog-compact textarea { width: 100%; box-sizing: border-box; }
.pm-dialog-compact input[type=date] { width: auto; }
.pm-dialog-compact .pm-hint { margin: .15rem 0 0; }
.pm-dialog-compact .pm-check { display: flex; align-items: center; gap: .4rem; margin: .4rem 0; }
.pm-sharing-recipient { display: inline; }
.pm-recipients .pm-menu-wrap { display: inline-block; }
.pm-recipients li { margin: .15rem 0; }
/* 2.6.2: a recipient's address is the button that opens that recipient's menu; it reads as text with a menu cue. */
button.pm-link-button { background: none; border: 1px solid transparent; color: var(--accent); padding: .1rem .3rem;
  text-decoration: underline; font-weight: 600; cursor: pointer; }
button.pm-link-button::after { content: " BE"; text-decoration: none; display: inline-block; margin-left: .15rem; }
button.pm-link-button:hover, button.pm-link-button[aria-expanded="true"] { border-color: var(--line); background: var(--soft); }

/* 2.6.9 folder picker */
.pm-tree, .pm-tree [role=group] { list-style: none; margin: 0; padding-left: 1.25rem; }
.pm-tree { padding-left: 0; max-height: 16rem; overflow: auto; border: 1px solid var(--pm-border, #888); }
.pm-tree [role=treeitem] > span { display: inline-block; padding: .15rem .4rem; }
.pm-tree [role=treeitem][aria-expanded] > span::before { content: "\25B8\00a0"; }
.pm-tree [role=treeitem][aria-expanded=true] > span::before { content: "\25BE\00a0"; }
.pm-tree [role=treeitem][aria-selected=true] > span { background: var(--pm-accent, #1a5fb4); color: #fff; }
.pm-tree [role=treeitem]:focus { outline: none; }
.pm-tree [role=treeitem]:focus > span { outline: 3px solid var(--pm-focus, #c00); outline-offset: 1px; }

/* File manager: native table controls; the shared dialog supplies containment. */
.pm-file-manager{width:90rem;max-width:96vw;height:88dvh;max-height:92dvh;box-sizing:border-box}
.pm-file-manager[open]{display:flex;flex-direction:column;gap:.5rem}
.pm-file-manager h2,.pm-file-manager p{margin:.25rem 0}
.pm-file-manager-panes{display:grid;grid-template-columns:minmax(12rem,28%) minmax(0,1fr);gap:1rem;flex:1;min-height:0}
.pm-file-manager-panes>.pm-folder-picker,.pm-file-manager [data-fm-contents]{overflow:auto;min-width:0}
.pm-file-manager [data-fm-table]{width:100%;table-layout:fixed}
.pm-file-manager [data-fm-table] th:first-child{width:8rem}
.pm-file-manager [data-fm-table] th:nth-child(2){width:48%}
.pm-file-name{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:40rem){.pm-file-manager-panes{grid-template-columns:minmax(8rem,35%) minmax(0,1fr)}}

/* Playback information is moved below the stage; bound its text in that actual container. */
.pm-play-extra { min-width:0; max-width:100%; }
.pm-play-extra .pm-viewer-desc,.pm-play-extra .pm-player-transcript { min-width:0; width:100%; max-width:100%; overflow-wrap:anywhere; margin:.5rem 0; padding:.6rem .75rem; border:1px solid var(--line); border-inline-start:3px solid var(--accent); border-radius:4px; background:var(--soft); }
.pm-play-extra .pm-player-lines,.pm-play-extra ol,.pm-play-extra li { min-width:0; max-width:100%; overflow-wrap:anywhere; }
.pm-play-types { flex-wrap:wrap; gap:.5rem 1rem; padding:.35rem .6rem; border:1px solid var(--line); border-radius:4px; background:var(--soft); }
.pm-play-types span { white-space:nowrap; }
#play-go-number { width:6rem; }
