/* Playlists: the Playlists page, the page of a playlist and its windows (maquettes/listes-lecture.html). */
.playlist-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.playlist-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); display: flex; flex-direction: column; color: var(--text); height: 100%; }
.playlist-open { display: flex; flex-direction: column; flex: 1; color: inherit; text-decoration: none; }
.playlist-open::after { content: ""; position: absolute; inset: -1px; border-radius: var(--r-lg); }
.playlist-open:focus-visible { outline: none; }
.playlist-open:focus-visible::after { outline: 2px solid var(--focus); outline-offset: -2px; }
.playlist-open .mosaic { border-radius: calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px) 0 0; }
.playlist-usage { display: flex; padding: 0 12px 12px; margin-top: -4px; }
.mosaic { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; aspect-ratio: 16 / 10; background: var(--border); border-bottom: 1px solid var(--border); overflow: hidden; }
.mosaic img { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--surface-2); min-height: 0; }
.mosaic-one { grid-template-columns: 1fr; grid-template-rows: 1fr; }
.mosaic-two { grid-template-rows: 1fr; }
.mosaic-three img:first-child { grid-row: span 2; }
.mosaic-empty { display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--text-2); font-size: 13px; }
.playlist-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.playlist-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.playlist-meta { font-size: 12px; color: var(--text-2); }

.playlist-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.playlist-title { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.playlist-title h1 { overflow-wrap: anywhere; }
.playlist-head .row-menu .menu { top: 40px; }
.alert .row-inline { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

.content-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.content-list > li + li { border-top: 1px solid var(--border); }
.content-row { display: grid; grid-template-columns: 28px 96px minmax(0, 1fr) 150px 120px; gap: 16px; align-items: center; padding: 12px 16px; }
.content-pos { color: var(--text-2); font-size: 13px; text-align: right; }
.content-thumb { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border); }
.content-open { color: var(--text); text-decoration: none; min-width: 0; }
.content-open b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content-open small, .content-time small { display: block; font-size: 12px; color: var(--text-2); }
.content-time { font-variant-numeric: tabular-nums; }
.content-time .stepper { --h: 32px; }
.content-time .stepper input.stepper-value { width: 56px; font-size: 13px; }
.content-time .stepper + small { margin-top: 4px; padding-left: 2px; }
.content-row .row-actions { margin: 0; }
.list-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Page of a playlist: the applications column and drag-and-drop (maquettes/listes-applications-videos.html). */
.page-with-panel { display: grid; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; min-height: 100vh; }
.playlist-content { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.content-row.draggable { grid-template-columns: 24px 28px 96px minmax(0, 1fr) 150px 120px; }
.content-open small.content-type { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.grip { display: inline-grid; place-items: center; width: 24px; height: 32px; padding: 0; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-3); cursor: grab; touch-action: none; }
.grip:hover, .content-row.taken .grip { background: var(--hover); color: var(--text); }
.grip:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.content-row.lifted { position: relative; z-index: 2; background: var(--surface); box-shadow: var(--shadow-float); border-radius: var(--r); cursor: grabbing; }
.content-row.taken { background: var(--selected); }
.content-list.parting > .content-row { transition: transform 160ms ease; }
.content-list.parting { transition: padding-bottom 160ms ease; }
.content-list.parting > .content-row.lifted { transition: none; }
.content-list.parting > .content-row.landing { transition: transform 120ms ease; }
.list-drop { border: 1.5px dashed var(--border-strong); border-radius: var(--r-lg); background: var(--surface); }
.list-drop.over { border-color: var(--focus); background: var(--selected); }
.app-panel { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--border); }
.app-panel .app-list:last-of-type { flex: 1; }
.app-panel-head { padding: 16px 16px 12px; display: flex; flex-direction: column; gap: 12px; border-bottom: 1px solid var(--border); }
.app-panel-head h2 { font-size: 15px; font-weight: 500; margin: 0; display: flex; justify-content: space-between; align-items: baseline; }
.app-panel-head h2 small { font-size: 12px; font-weight: 400; color: var(--text-3); }
.app-group { font-size: 12px; color: var(--text-3); margin: 12px 16px 4px; }
.app-list { list-style: none; margin: 0; padding: 4px 8px 8px; }
.app-item { display: grid; grid-template-columns: 36px minmax(0, 1fr) var(--h-sm); gap: 10px; align-items: center; padding: 8px; border-radius: var(--r); cursor: grab; }
.app-item:hover { background: var(--hover); }
.app-item b { display: block; font-weight: 500; font-size: 14px; }
.app-item small { display: block; font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-item .icon-btn { width: var(--h-sm); height: var(--h-sm); border: 1px solid var(--border-strong); color: var(--text); }
.app-item.dragging { opacity: 0.4; }
.app-panel-foot { padding: 12px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-2); display: flex; gap: 8px; align-items: flex-start; }

/* Add window of a media application (charte « Fenêtre d'ajout »). */
.modal-picker { max-width: min(1320px, calc(100vw - 64px)); }
.with-dot { display: flex; gap: 10px; align-items: center; }
.picker-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 16px 24px; border-bottom: 1px solid var(--border); }
.picker-bar .field.search { width: 340px; max-width: 100%; margin: 0; }
.picker-bar .spacer { flex: 1; }
.picker-count { font-size: 13px; }
.picker-import { margin: 0; }
.picker-body { padding: 20px 24px; max-height: calc(100vh - 300px); overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.picker-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tile { position: relative; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); cursor: pointer; }
.tile:has(input:checked) { border-color: var(--focus); box-shadow: 0 0 0 2px var(--focus); }
.tile:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.tile-thumb { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--surface-2); }
.tile-name { padding: 8px 10px 0; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-meta { padding: 0 10px 8px; font-size: 12px; color: var(--text-2); }
.tile .check { position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.9); border: 1.5px solid rgba(11, 31, 58, 0.35); }
.tile:has(input:checked) .check { background: var(--focus); border-color: var(--focus); }
.tile:has(input:checked) .check::after { content: ""; width: 10px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.picker-foot-note { margin-right: auto; font-size: 13px; color: var(--text-2); }
.picker-foot-note b { color: var(--text); font-weight: 500; }
.link-button { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }

@media (max-width: 960px) {
  .page-with-panel { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .app-panel { position: static; height: auto; border-left: 0; border-top: 1px solid var(--border); }
}
@media (max-width: 720px) {
  .playlist-grid { grid-template-columns: minmax(0, 1fr); }
  .content-row { grid-template-columns: 72px minmax(0, 1fr) auto; grid-template-areas: "thumb name time" "thumb actions actions"; gap: 4px 10px; }
  .content-row .content-pos { display: none; }
  .content-row .content-thumb { grid-area: thumb; }
  .content-row .content-open { grid-area: name; }
  .content-row .content-time { grid-area: time; text-align: right; }
  .content-row .row-actions { grid-area: actions; justify-content: flex-start; }
  .playlist-head .row-menu .menu { left: 0; right: auto; }
  .content-row.draggable { grid-template-columns: 24px 72px minmax(0, 1fr) auto; grid-template-areas: "grip thumb name time" "grip thumb actions actions"; }
  .content-row.draggable .grip { grid-area: grip; }
  .modal-picker { max-width: 100%; }
  .picker-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* Aperçu d'un contenu au format des écrans de la liste (maquettes/ecrans-cartes-format.html, cadre 5). */
.preview-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: var(--h-sm); }
.preview-formats { border: 0; padding: 0; margin: 0; }
.preview-formats .chip { cursor: pointer; }
.preview-formats .chip:has(input:checked) { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.preview-formats .chip:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.preview:has([name="preview-format"][value="portrait"]:checked) .preview-stage { width: min(100%, max(200px, (100vh - 300px) * 9 / 16)); aspect-ratio: 9 / 16; }

/* Réglages > Applications and Widgets (applications.md, rules 15 to 19) */
.page-lead { margin: 0; max-width: 760px; }
.app-group-title { font-size: 12px; font-weight: 400; color: var(--text-3); margin: 8px 0 -8px; }
.app-rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.app-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto auto; align-items: center; gap: 16px; padding: 14px 20px; }
.app-row + .app-row { border-top: 1px solid var(--border); }
.app-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.app-row-text b { font-weight: 500; }
.app-row-text small { font-size: 13px; color: var(--text-2); }
.app-row-use { font-size: 12px; color: var(--text-2); white-space: nowrap; }
.app-row.is-off .app-dot { filter: grayscale(1); opacity: 0.55; }
.app-row.is-off .app-row-text b { color: var(--text-2); }
.app-switch { border: 0; background: none; padding: 4px 0; cursor: pointer; display: inline-flex; }
.app-switch .track { width: 36px; height: 20px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background 0.15s; }
.app-switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: left 0.15s; }
.app-switch[aria-checked="true"] .track { background: var(--primary); }
.app-switch[aria-checked="true"] .track::after { left: 18px; background: var(--primary-text); }
.app-switch:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 999px; }
.dot-letters { font-size: 13px; font-weight: 600; letter-spacing: -0.02em; }
.cat-group { display: flex; flex-direction: column; gap: 16px; }
.cat-group[hidden] { display: none; }
.cat-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.cat-tile { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px 12px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.cat-tile[hidden] { display: none; }
.cat-tile > .tag, .cat-tile > .btn { grid-column: 2; justify-self: start; }
.cat-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cat-text b { font-weight: 500; }
.cat-text small { font-size: 13px; color: var(--text-2); }
.cat-tile.is-soon .app-dot { filter: grayscale(1); opacity: 0.5; }
.cat-tile.is-soon .cat-text b { color: var(--text-2); }
.cat-search { max-width: 360px; }
@media (max-width: 700px) {
  .app-row { grid-template-columns: 36px minmax(0, 1fr) auto; padding: 12px 14px; }
  .app-row-use { grid-column: 2; grid-row: 2; }
  .app-row > :last-child { grid-column: 3; grid-row: 1 / span 2; }
  .page-full > .page-head .btn { width: 100%; justify-content: center; }
}
.app-none { margin: 12px 16px; font-size: 13px; }
