/*
 * Rooster One's meta boxes on WordPress's own screens: the order screen and the orders list (the cancellation box,
 * the marketplace order box and its column), the post editors (the SEO box, the store's location).
 *
 * The library's chrome does not paint these screens, so the boxes take their layout from this sheet and their
 * colours from the plugin's tokens (aieo-tokens.css, enqueued with it by AIEO_DMM::enqueue_metabox_style()). Each
 * colour keeps WordPress's own as the fallback inside var(). Until the cleanup of 7 Nov 2026 (package M1) these
 * were static style attributes, colour literals and two <style> blocks printed with the markup.
 */

/* ── The shared recipe ─────────────────────────────────────────────────────────────────────────────────────── */

/* A field as wide as its box (selects, the note, the cost inputs). */
.aieo-mb-full {
	width: 100%;
	max-width: 100%;
}

/* Room under a field that closes a section. */
.aieo-mb-gap {
	margin-bottom: 12px;
}

/* A section's bold heading line, and the hint under it. The hints, the note and the tip are often WordPress's
   description paragraph, whose own margins (p.description) would win over one class: each is paired with it. */
.aieo-mb-head {
	margin: 14px 0 2px;
}
.aieo-mb-hint,
.description.aieo-mb-hint {
	margin: 0 0 6px;
}

/* A hint that answers the field just above it (the reason filter's note). */
.aieo-mb-field-note,
.description.aieo-mb-field-note {
	margin-top: -6px;
}

/* The closing tip of a box. */
.aieo-mb-tip,
.description.aieo-mb-tip {
	margin-top: 8px;
}

/* A list of radios or boxes, one per line, or side by side with is-inline. */
.aieo-mb-choices {
	margin: 0 0 12px;
	padding-left: 0;
	list-style: none;
}
.aieo-mb-choices > li {
	margin: 3px 0;
}
.aieo-mb-choices.is-inline > li {
	display: inline-block;
	margin: 2px 12px 2px 0;
	vertical-align: top; /* a checked radio's baseline is its dot's: on the baseline the chosen one sat lower */
}
.aieo-mb-choice-text {
	font-size: var(--aieo-text-xs, 12px);
	line-height: 1.3;
}

/* The library's check label (rooster-admin-check) in a meta box. The library takes the box's own margins away and
   spaces it from --ra-spacing, which only its chrome and islands declare, so off the chrome the gap fell to nothing and
   WordPress's -4px top margin pushed the circle into its words. The library's geometry, its own expressions with a
   fallback, the same inside an island (the lead's follow-up to package M1, 7 Nov 2026). */
.postbox .rooster-admin-check:where(:not(.is-bare)) {
	gap: calc(var(--ra-spacing, 0.25rem) * 2);
}
.postbox .rooster-admin-check:where(:not(.is-bare)) > input:is([type="checkbox"], [type="radio"]) {
	font-size: inherit;
	line-height: inherit;
	margin-top: calc((1lh - 1rem) / 2);
}

/* A small field: the label above its control, a quiet line between fields. */
.aieo-mb-field {
	margin: 2px 0;
}
.aieo-mb-label {
	display: block;
	margin-bottom: 2px;
	font-size: var(--aieo-text-2xs, 11px);
	color: var(--aieo-tone-secondary, #50575e);
}

/* Secondary words inside a line (a quantity, "Not recorded"). */
.aieo-mb-muted {
	color: var(--aieo-muted-fg, #646970);
}

/* The status line a script writes after an action: quiet while working, toned when the answer arrives. */
.aieo-mb-status {
	font-size: var(--aieo-text-xs, 12px);
	color: var(--aieo-muted-fg, #646970);
}
.aieo-mb-status.is-small {
	font-size: var(--aieo-text-2xs, 11px);
}
.aieo-mb-status.is-success {
	color: var(--aieo-tone-success, #00a32a);
}
.aieo-mb-status.is-error {
	color: var(--aieo-tone-danger, #d63638);
}

/* ── The marketplace order box (the order screen) ──────────────────────────────────────────────────────────── */

.aieo-moi-actions {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-top: 10px;
}
.aieo-moi-accept-form {
	margin-bottom: 4px;
}
.aieo-moi-accept-title {
	margin: 0 0 6px;
	font-size: var(--aieo-text-xs, 12px);
}
.aieo-moi-accept-form select {
	width: 100%;
	margin-bottom: 6px;
}
.aieo-moi-accept-form .aieo-moi-parcels {
	width: 80px;
}

/* The marketplace's state of the order, as a pill: in the box and in the orders list's column. */
.aieo-moi-state {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 4px;
	background: var(--aieo-mono-soft, #f0f0f1);
	color: var(--aieo-mono-soft-fg, #1d2327);
	font-size: var(--aieo-text-2xs, 11px);
	font-weight: 600;
}
.aieo-moi-state-accepted {
	background: var(--aieo-success-soft, #edfaef);
	color: var(--aieo-success-soft-fg, #005c12);
}
.aieo-moi-state-rejected,
.aieo-moi-state-cancelled {
	background: var(--aieo-destructive-soft, #fcf0f1);
	color: var(--aieo-destructive-soft-fg, #8a2424);
}
.aieo-moi-state-shipped {
	background: var(--aieo-primary-soft, #f0f6fc);
	color: var(--aieo-primary-soft-fg, #0a4b78);
}

/* ── The marketplace column (the orders list) ──────────────────────────────────────────────────────────────── */

.aieo-moi-cell {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: var(--aieo-text-xs, 12px);
}
.aieo-moi-cell .aieo-moi-state {
	padding: 1px 6px;
	border-radius: 3px;
	line-height: 1.4;
}
.aieo-moi-cell-tracking {
	margin-top: 2px;
}
.aieo-moi-cell-tracking code {
	font-size: var(--aieo-text-2xs, 11px);
}
.aieo-moi-row-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-top: 4px;
}

/* Accept and Reject keep their own tone on WordPress's button, at rest, on hover and on focus (a disabled button
   stays WordPress's, whose rule is !important). */
.aieo-moi-row-actions .button.aieo-moi-accept-btn,
.aieo-moi-row-actions .button.aieo-moi-accept-btn:hover,
.aieo-moi-row-actions .button.aieo-moi-accept-btn:focus {
	background: var(--aieo-tone-success, #00a32a);
	border-color: var(--aieo-tone-success, #00a32a);
	color: var(--aieo-success-fg, #fff);
}
.aieo-moi-row-actions .button.aieo-moi-reject-btn,
.aieo-moi-row-actions .button.aieo-moi-reject-btn:hover,
.aieo-moi-row-actions .button.aieo-moi-reject-btn:focus {
	background: var(--aieo-tone-danger, #d63638);
	border-color: var(--aieo-tone-danger, #d63638);
	color: var(--aieo-destructive-fg, #fff);
}

/* An order the webhook and the poll missed, caught by a manual reconcile. */
.aieo-moi-reconciled {
	display: inline-block;
	margin-top: 2px;
	padding: 1px 6px;
	border-radius: 3px;
	background: var(--aieo-warning-soft, #fcf9e8);
	color: var(--aieo-warning-soft-fg, #8a6116);
	font-size: 10px;
	font-weight: 600;
}

/* ── Our columns on WooCommerce's products list ────────────────────────────────────────────────────────────── */

/* WooCommerce gives each of its columns a width (78% in percentages and about 470px more), past the fixed table's
   width at every screen size, so a column without one got none (0 wide, its header running past the page). Engaged
   and Contacts are hidden there by default (the owner, 7 Nov 2026); turned on in Screen Options, they take these
   widths, in ch as WooCommerce sizes its own numbers. Pro's Supplier is in Pro's sheet. */
.post-type-product table.wp-list-table .column-aieo_views {
	width: 11ch;
}
.post-type-product table.wp-list-table .column-aieo_contacts {
	width: 10ch;
}

/* ── Package M2: more of the shared recipe ─────────────────────────────────────────────────────────────────── */

/* Fields side by side (the dates, the prize, the two images), wrapping in a narrow box; each column shares the row. */
.aieo-mb-row {
	display: flex;
	flex-wrap: wrap;
	gap: 24px;
}
.aieo-mb-row.is-spaced {
	margin-top: 16px;
}
.aieo-mb-col {
	flex: 1;
	min-width: 200px;
}

/* A number or a code beside its label (the winners, the prize, the fee, the currency). */
.aieo-mb-short {
	width: 140px;
	max-width: 100%;
}

/* A term picker as wide as its box, up to a line's width (Select2 then takes the whole box). */
.aieo-mb-select {
	width: 100%;
	max-width: 520px;
}

/* The Gravity Forms picker, as wide as a form's name. */
.aieo-mb-form-select {
	min-width: 260px;
	max-width: 100%;
}

/* A box's first description, against its title (paired with .description: WordPress's p.description margin weighs more). */
.aieo-mb-lead,
.description.aieo-mb-lead {
	margin-top: 0;
}

/* The line between a box's parts. */
.aieo-mb-rule {
	margin: 18px 0;
}

/* A control a box hides until it applies (an image's or a video's Remove), by the hidden attribute its script toggles:
   WordPress's .button display would show it otherwise (the static display:none it replaces won as an inline style). */
.postbox .button[hidden],
.postbox .button-link[hidden] {
	display: none;
}

/* A chosen image's preview, hidden by the attribute until there is one (the editor's script toggles it). */
.aieo-mb-preview {
	max-width: 100%;
	height: auto;
	border: 1px solid var(--aieo-border, #dcdcde);
	border-radius: var(--aieo-radius-md, 6px);
}

/* The competition's insights: a bulleted list, a group's first line set apart. */
.aieo-mb-bullets {
	margin: 0;
	padding-left: 18px;
	list-style: disc;
}
.aieo-mb-bullets > .is-group {
	margin-top: 6px;
}

/* A published competition's share links: the network, then the link to copy. */
.aieo-mb-share {
	margin: 0;
}
.aieo-mb-share code {
	font-size: var(--aieo-text-xs, 12px);
}
.aieo-mb-share input {
	width: 70%;
}

/* ── The social box and the social video box (every content type's editor, its side column) ────────────────── */

.aieo-social-mb-note {
	margin: 0 0 8px;
	font-size: var(--aieo-text-xs, 12px);
	color: var(--aieo-tone-secondary, #50575e);
}
.aieo-social-mb-hint {
	margin: 0 0 8px;
	font-size: var(--aieo-text-2xs, 11px);
	color: var(--aieo-muted-fg, #646970);
}
.aieo-social-mb-flush {
	margin: 0;
}
.aieo-social-mb-actions {
	margin: 0 0 8px;
}
.aieo-social-mb .aieo-social-mb-accounts {
	margin: 0 0 10px;
}

/* One generated draft: its platform, the text to edit, its length and Publish, then the answers. */
.aieo-social-draft {
	margin: 0 0 12px;
}
.aieo-social-draft-platform {
	margin-bottom: 4px;
	font-size: var(--aieo-text-2xs, 11px);
	font-weight: 600;
	color: var(--aieo-tone-secondary, #50575e);
}
.aieo-social-draft .aieo-social-text {
	width: 100%;
	min-height: 70px;
	font-size: var(--aieo-text-xs, 12px);
}
.aieo-social-draft-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: 4px;
}
.aieo-social-result {
	margin-top: 4px;
}

.aieo-social-video-actions {
	margin: 0 0 6px;
}
.aieo-social-video-name {
	margin: 0 0 8px;
	font-size: var(--aieo-text-2xs, 11px);
	color: var(--aieo-tone-secondary, #50575e);
	word-break: break-all;
}
.aieo-social-video-url {
	margin: 0 0 4px;
}
.aieo-social-video-url label {
	font-size: var(--aieo-text-xs, 12px);
	font-weight: 600;
}

/* ── Pro's translation box (the product, post and page editors) ────────────────────────────────────────────── */

.aieo-semtr-find {
	margin-top: 6px;
}
.aieo-semtr-note {
	display: block;
	margin-top: 6px;
}

/* ── The form's answers (the form editor): each question's head, and the written answers in the library's fold ── */

.aieo-fe-question {
	margin: 1.2em 0 0.3em;
}
.aieo-fe-key {
	font-size: var(--aieo-text-2xs, 11px);
	color: var(--aieo-muted-fg, #646970);
}
.aieo-fe-asked {
	font-weight: 400;
}
/* A list without markers, as WordPress's are, that scrolls when there are many answers. */
.rooster-admin .aieo-fe-written {
	max-height: 280px;
	margin: 0.5em 0 0 1.2em;
	overflow: auto;
}
.rooster-admin .aieo-fe-written > li {
	margin-bottom: 0.35em;
}
