/* Layout of the settings forms (js/fields.js) in Simple and Advanced: rows that line up, boxes wide enough to read, groups that look like groups.
 * No container queries here: a form also sits in boxes that take their width from it (the exact values of a picture area), and a query container has no width of its own. */
.pfw-grid { grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); gap: 12px; }
/* labels of one row may wrap to two lines: the boxes under them still line up */
.pfw-grid > .pfw-f:not(.wide) > .pfw-ll { flex: 1 0 auto; align-items: flex-end; }
.pfw-grid > .pfw-f:not(.wide) > .pfw-ll > .lt-tools { align-self: flex-end; margin-block: 0; }
.pfw-ll { min-block-size: 24px; }
/* a row where one box has a line of help under it lines up from the top instead */
.pfw-grid:has(> .pfw-f:not(.wide) > .th-block) > .pfw-f:not(.wide) > .pfw-ll { flex-grow: 0; }
.pfw-l { font-size: 12px; line-height: 1.35; }

/* A date box in a row of a form keeps its calendar button; the Today button beside it would squeeze the box to a few letters, and the calendar has its own Today. */
.th-row { flex-wrap: wrap; }
.th-row > input, .th-row > textarea { flex: 1 1 110px; min-inline-size: 0; }
.pfw-grid > .pfw-f:not(.wide) > .th-row > .th-btn:not(.th-icon) { display: none; }

/* a group inside a form (Seller, Buyer, Payment ...) is a titled section, not one more field label */
.pfw-grid > .pfw-f.wide:has(> .pfw-grid) { border: 1px solid var(--border); border-radius: 12px; padding: 12px; gap: 10px; margin-block-start: 4px; }
.pfw-grid > .pfw-f.wide:has(> .pfw-grid) > .pfw-ll > .pfw-l { font-size: 13.5px; font-weight: 800; color: var(--text); }
@media (max-width: 480px) {
  .pfw-grid > .pfw-f.wide:has(> .pfw-grid) { padding: 10px 8px; }
}

/* "More details": a full-width row that opens, not a loose pink word */
.pfw-more { margin-block-start: 2px; }
.pfw-more > summary { list-style: none; justify-content: space-between; gap: 10px; padding: 0 12px; min-block-size: 40px; border: 1px solid var(--border); border-radius: 10px; color: var(--text-muted); font-size: 12.5px; }
.pfw-more > summary::-webkit-details-marker { display: none; }
.pfw-more > summary::after { content: ""; flex: none; inline-size: 7px; block-size: 7px; border-inline-end: 2px solid currentColor; border-block-end: 2px solid currentColor; transform: rotate(45deg); margin-block-start: -4px; }
.pfw-more[open] > summary::after { transform: rotate(-135deg); margin-block-start: 3px; }
.pfw-more > summary:hover, .pfw-more > summary:focus-visible { color: var(--accent); border-color: var(--accent); outline: none; }
.pfw-more[open] > summary { margin-block-end: 12px; }

/* an error in the words of the form (js/error-text.js): the sentence is a button that jumps to the box, which is outlined */
.err-go { display: inline; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.err-code { font-size: 11px; opacity: .75; overflow-wrap: anywhere; }
.err-hint { margin-block-start: 4px; font-size: 12.5px; opacity: .9; }

/* recommended colours under a colour box, and a picture box (js/field-kinds.js) */
.pfw-image .pfw-hint { display: block; margin-block-start: 8px; }
.pfw-grid > .pfw-f:has(> .sm-colors), .pfw-grid > .pfw-f:has(> .pfw-image) { grid-column: 1 / -1; }

/* "Show all 30 choices" at the end of a list of chips */
.th-pill.th-showall { border-style: dashed; color: var(--accent); }

/* the invisible tap areas of the small icons reach a few pixels past the form: they must not make it scroll sideways */
#simpleForm, #paramsForm { overflow-x: clip; }

/* the "Exact values" of a picture area: its form fills the box */
.vp-exact > div { inline-size: 100%; min-inline-size: 0; }

/* a condition ("column  is  value") on a phone: the column takes its own line, the comparison and the value share the next one */
@media (max-width: 520px) {
  .pfw-cond > :first-child { flex: 1 1 100%; }
  .pfw-cond > .pl-select, .pfw-cond > select { min-inline-size: 104px; }
}

/* Rows of several boxes (a condition, a property of a schema): wherever there is not room for all of them, they wrap instead of squeezing each other to a few letters */
.pfw-line.pfw-cond, .pfw-line.pfw-schema { flex-wrap: wrap; }
.pfw-cond > .pl-select, .pfw-cond > select, .pfw-schema > .pl-select, .pfw-schema > select { flex: 1 1 120px; min-inline-size: 112px; }
.pfw-cond > input, .pfw-schema > input[type="text"] { flex: 1 1 110px; min-inline-size: 104px; }
/* number boxes that hold long numbers keep room for them */
.pat-num-stepper .nm-step > .nm-in, .pat-num-size .nm-wh-f .nm-in { min-inline-size: 84px; }

/* the remove button inside a column name of a table is bigger on a phone: the typed name stops before it */
@media (max-width: 480px) { .sm-form .pfw-colh input { padding-inline-end: 44px !important; } }
.pfw-schema > input[type="text"] { flex-basis: 130px; min-inline-size: 124px; }

/* "old name  to  new name" pairs: on the smallest phones the two boxes take a line each */
@media (max-width: 380px) { .pfw-line.pfw-kv { flex-wrap: wrap; } .pfw-kv > .pfw-cell { flex: 1 1 140px; } }

/* what the plan allows, under the box it limits (js/plan-caps.js) */
.plan-note{font-size:11px;line-height:1.35;color:var(--text-faint);margin-top:4px;}
.sm-field > .plan-note, .pf-field > .plan-note{grid-column:1 / -1;flex-basis:100%;}

/* a colour: the same row of circles in both tabs and inside list forms (js/color-row.js); the row takes the whole width */
.pf-field .pf-color{display:block;min-width:0;}
.pfw-grid > .pfw-f:has(> .sm-colors){grid-column:1 / -1;}
.sm-cdot:disabled,.sm-cpill:disabled{opacity:.55;cursor:default;}
