/*
 * Inline form rows (filters, sort bars, search bars, list-row actions). Loaded after every screen stylesheet.
 * Rule: the fields, selects and buttons of one row share one height and one bottom edge; labels sit above their
 * field (filters) or beside it (list rows) and never push the row; badges are centred on the row.
 * The stacking spacer of .pfield (margin-bottom, including the accessibility density variants) only applies to
 * forms laid out in a column, so it is cancelled inside these rows. Checked by tests/e2e/layout-audit.js.
 */

/* 1. Filter and sort rows: labels above, controls aligned on the bottom edge of the fields. */
.platform[class] :is(.admin-list-filters,.cms-filters,.translation-filters,.taxonomy-filters,.community-feed-filters,.reaction-filter,.report-filters,.plus-filters,.search-sort,.compare-search,.gallery-style-form,.fad-switch,.ticket-filters,.message-filters,.submissions-filters,.saved-search-filters,.laurel-filters,.filter-bar,.film-theme-picker,.fad-form,.saved-search-form,.submissions-advanced,.inline-form-row){align-items:end}
.platform[class] :is(.admin-list-filters,.cms-filters,.translation-filters,.taxonomy-filters,.community-feed-filters,.reaction-filter,.report-filters,.plus-filters,.search-sort,.compare-search,.gallery-style-form,.fad-switch,.ticket-filters,.message-filters,.submissions-filters,.saved-search-filters,.laurel-filters,.filter-bar,.film-theme-picker,.fad-form,.saved-search-form,.submissions-advanced,.inline-form-row) .pfield{margin:0!important}
.platform[class] :is(.admin-list-filters,.cms-filters,.translation-filters,.taxonomy-filters,.community-feed-filters,.reaction-filter,.report-filters,.plus-filters,.search-sort,.compare-search,.gallery-style-form,.fad-switch,.ticket-filters,.message-filters,.submissions-filters,.saved-search-filters,.laurel-filters,.filter-bar,.film-theme-picker,.fad-form,.saved-search-form,.submissions-advanced,.inline-form-row)>:is(.pbtn,button){height:44px;margin-block:0!important;align-self:end}
.platform[class] :is(.admin-list-filters,.cms-filters,.translation-filters,.taxonomy-filters,.community-feed-filters,.reaction-filter,.report-filters,.plus-filters,.search-sort,.compare-search,.gallery-style-form,.fad-switch,.ticket-filters,.message-filters,.submissions-filters,.saved-search-filters,.laurel-filters,.filter-bar,.film-theme-picker,.fad-form,.saved-search-form,.submissions-advanced,.inline-form-row) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not([type=hidden]),select){height:44px}

/* 2. List rows (badge + inline select + button): label beside its field, every item centred on one line. */
.platform[class] :is(.file-row,.ptable td,.list-row)>form{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-block:0}
.platform[class] :is(.file-row,.ptable td,.list-row)>form>.pfield:not(:has(textarea)){flex-direction:row;align-items:center;gap:8px;margin:0!important;min-width:0}
.platform[class] :is(.file-row,.ptable td,.list-row)>form>.pfield>span{white-space:nowrap}
.platform[class] :is(.file-row,.ptable td,.list-row)>form>.pfield :is(input:not([type=checkbox]):not([type=radio]),select){height:44px;width:auto;min-width:0}
.platform[class] :is(.file-row,.ptable td,.list-row)>form>:is(.pbtn,button){height:44px;margin-block:0!important}
.platform[class] :is(.file-row,.list-row)>.ptag{align-self:center}
.platform[class] :is(.file-row,.ptable td,.list-row)>form>.pfield:has(textarea){flex:1 1 100%;margin:0!important}

/* 3. Screen-specific rows. */
/* Search pill: the button sits inside the field frame, centred, without the stacked-form spacer. */
.platform[class] .psearch>:is(.pbtn,button){margin-block:0!important}
/* Advertising forms: the price table spans the whole grid instead of overlapping the fields beside it. */
.platform[class] .fad-form{row-gap:var(--space-4)}
.platform[class] .fad-form>:is(table,h3,p,details){grid-column:1/-1}
/* Distribution cards: status badge centred on the action button. */
.platform[class] .distribution-list>article{align-items:center;align-content:flex-start}
/* Submissions pagination: the Apply button takes the height of the page-size select. */
.platform[class] .submissions-pagination form{align-items:stretch}
.platform[class] .submissions-pagination form>:is(button,.pbtn){display:inline-flex;align-items:center;margin-block:0}
/* Submissions "Help" menu drawn as a select: same label row and 44 px box as the filters beside it. */
@media(min-width:761px){
 .platform[class] .submissions-filter-row>.submissions-help{align-self:end;min-height:72px}
 .platform[class] .submissions-help summary{padding:0 0 52px;line-height:20px}
 .platform[class] .submissions-help summary:after{inset:28px 0 auto;height:44px}
 .platform[class] .submissions-help summary>span{transform:translateY(40px)}
 .platform[class] .submissions-help>div{top:76px}
}
/* Action bars: when one label wraps on a narrow screen, every button of the bar takes the same height. */
.platform[class] .community-post-actions{align-items:stretch}
/* Tables placed directly in a card scroll inside the card on narrow screens instead of widening the page. */
@media(max-width:900px){.platform[class] .pbox>table.ptable{display:block;max-width:100%;overflow-x:auto}}
/* KPI cards: a long value (translated policy names) wraps under its label instead of widening the page. */
.platform[class] .pkpi{flex-wrap:wrap;min-width:0}
.platform[class] .pkpi>strong{min-width:0;overflow-wrap:anywhere}
/* Two-column form grids: when one label wraps onto two lines, the field still lines up with its neighbour
   (the label stays at the top of the cell, the control is pushed to the bottom of the stretched cell). */
.platform[class] .pfield>:is(input:not([type=checkbox]):not([type=radio]):not([type=range]),select){margin-top:auto}
/* Search filter panels in two columns: the submit and reset buttons take a full row. */
.platform[class] .search-filter-form>:is(.pbtn,.search-clear){grid-column:1/-1}
/* Film creation side illustration never exceeds its column. */
.platform[class] .create-photo .art{max-width:100%}
/* Min/max ranges next to a select in the two-column filter panel: same bottom edge as the select. */
.platform[class] .search-filter-form>fieldset.film-range{align-self:end;margin-bottom:0}
/* Fieldsets shrink with their column (browser default min-width:min-content let long hints widen the page);
   long badges inside a choice label wrap instead of overflowing. */
.platform[class] fieldset{min-width:0}
.platform[class] :is(label,fieldset) .ptag{max-width:100%;white-space:normal;overflow-wrap:anywhere}
/* Table rows: inline controls keep one height (a button label no longer wraps beside a number field). */
.platform[class] .ptable td>.pbtn{white-space:nowrap}
.platform[class] .ptable td>input:not([type=checkbox]):not([type=radio]):not([type=hidden]){height:44px}

/* Signalement d'un message dans une conversation : champ et bouton alignés, même hauteur. */
form.message-inline{display:flex;align-items:flex-end;gap:8px;flex-wrap:wrap;margin-top:8px}
form.message-inline label{flex:1 1 220px;margin:0;display:flex;flex-direction:column;gap:4px}
form.message-inline input,form.message-inline .pbtn{height:36px;min-height:36px;box-sizing:border-box}
form.message-inline .pbtn{margin:0;align-self:flex-end}
