/* Content section: only what Unfold has no component for (docs/design.md). Buttons, cards, labels and titles are
   Unfold components in the templates. Everything here is written on Unfold's tokens, so it follows the theme. */

/* --- tokens & base ------------------------------------------------------------------------------------------ */
.hm { --hm-border: var(--color-base-200); --hm-muted: var(--color-base-500); --hm-card: #fff; --hm-soft: var(--color-base-50);
      --hm-tab-bg: var(--color-base-100); --hm-tab-active: #fff; --hm-input-border: var(--color-base-200);
      --hm-radius: var(--border-radius, 6px); --hm-control: 38px;
      display: flex; flex-direction: column; gap: 16px; }
.dark .hm { --hm-border: var(--color-base-800); --hm-muted: var(--color-base-400); --hm-card: var(--color-base-900); --hm-soft: rgb(255 255 255 / .02);
      --hm-tab-bg: rgb(255 255 255 / .06); --hm-tab-active: var(--color-base-700); --hm-input-border: var(--color-base-700); color-scheme: dark; }
[x-cloak] { display: none !important; }
.hm a:not([class]) { color: inherit; }
.hm-muted { color: var(--hm-muted); }
.hm-small { font-size: 12px; }
.hm-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.hm-bad { color: var(--color-red-600); }
.dark .hm-bad { color: var(--color-red-500); }
.hm-count { margin-left: 6px; color: var(--hm-muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.hm button:disabled { opacity: .5; cursor: not-allowed; }
.hm :is(a, button, select, input, summary, textarea):focus-visible { outline: 2px solid var(--color-primary-600); outline-offset: 2px; }

/* --- layout ------------------------------------------------------------------------------------------------- */
.hm-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.hm-head > .hm-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hm-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.hm-stack { display: flex; flex-direction: column; gap: 12px; }
.hm-stack > :is(button, a), .hm > .hm-seg { align-self: flex-start; }
.hm-spacer { margin-left: auto; }
.hm-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .hm-layout { grid-template-columns: minmax(0, 1fr); } }
.hm-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
/* Table container: an Unfold card without padding. */
.hm-panel { background: var(--hm-card); border: 1px solid var(--hm-border); border-radius: var(--hm-radius); box-shadow: 0 1px 2px rgb(0 0 0 / .05); overflow: hidden; }
/* Filter bar: the card look without clipping, so dropdowns can open over the content below. */
.hm-bar { background: var(--hm-card); border: 1px solid var(--hm-border); border-radius: var(--hm-radius); box-shadow: 0 1px 2px rgb(0 0 0 / .05); padding: 12px; }
.hm-alert { align-self: flex-start; margin: 0; padding: 8px 12px; border-radius: var(--hm-radius); background: var(--color-red-100, #fee2e2); color: var(--color-red-700, #b91c1c); }

/* --- controls: same look as Unfold's form widgets ----------------------------------------------------------- */
.hm-input, .hm-select { font: inherit; font-size: 14px; font-weight: 500; padding: 8px 12px; min-height: var(--hm-control); box-sizing: border-box;
      border: 1px solid var(--hm-input-border); border-radius: var(--hm-radius); background-color: var(--hm-card); color: inherit; box-shadow: 0 1px 2px rgb(0 0 0 / .05); }
.hm-input::placeholder { color: var(--color-base-400); font-weight: 400; }
.hm-input:focus, .hm-select:focus { outline: 2px solid var(--color-primary-600); outline-offset: -2px; }
.hm-select { appearance: none; padding-right: 32px; cursor: pointer; background-repeat: no-repeat; background-position: right 12px center; background-size: 10px 6px;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2371717a' stroke-width='1.5'/%3E%3C/svg%3E"); }
.hm-search { display: flex; flex: 1 1 220px; min-width: 0; }
.hm-search .hm-input { flex: 1; min-width: 0; }
.hm-textarea { width: 100%; resize: vertical; }
.hm-field { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.hm-range .hm-input { width: 72px; }
.hm-range--dates .hm-input { width: auto; }

/* A control that cannot be the button component (a label around a file input, a dropdown trigger): default button. */
.hm-control { font: inherit; font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; min-height: var(--hm-control);
      box-sizing: border-box; white-space: nowrap; cursor: pointer; border: 1px solid var(--hm-input-border); border-radius: var(--hm-radius);
      background: var(--hm-card); color: var(--color-font-important-light); box-shadow: 0 1px 2px rgb(0 0 0 / .05); }
.dark .hm-control { background: transparent; color: var(--color-font-important-dark); }
.hm-control:hover { background: var(--hm-tab-bg); }
.hm-control.is-active { border-color: var(--color-primary-600); }
.hm-control:has(input:focus-visible) { outline: 2px solid var(--color-primary-600); outline-offset: 2px; }
.hm-caret::after { content: "expand_more"; font-family: "Material Symbols Outlined"; font-size: 18px; line-height: 1; margin-right: -4px; color: var(--hm-muted); }

/* Segmented radios / links: Unfold's tab list (white chip on a grey track). */
.hm-seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--hm-radius); background: var(--hm-tab-bg); font-weight: 500; }
.hm fieldset.hm-seg { margin: 0; border: 0; min-width: 0; }
.hm-seg input { position: absolute; opacity: 0; pointer-events: none; }
.hm-seg label, .hm-seg a { padding: 5px 10px; border-radius: var(--hm-radius); cursor: pointer; white-space: nowrap; text-decoration: none;
      color: var(--color-font-important-light); }
.dark .hm-seg :is(label, a) { color: var(--color-font-important-dark); }
.hm-seg label:hover, .hm-seg a:hover { background: rgb(0 0 0 / .04); }
.hm-seg input:checked + label, .hm-seg a.is-active { background: var(--hm-tab-active); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.hm-seg input:focus-visible + label { outline: 2px solid var(--color-primary-600); outline-offset: -2px; }

.hm-radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.hm-radio input { accent-color: var(--color-primary-600); }
.dark .hm-radio input { accent-color: var(--color-base-200); }

/* Checkbox drawn next to a visually hidden input: Unfold's checkbox (border, primary fill, check_small icon). */
.hm-check { position: relative; width: 16px; height: 16px; flex: none; box-sizing: border-box; border: 1px solid var(--color-base-300); border-radius: 4px;
      background: var(--hm-card); box-shadow: 0 1px 2px rgb(0 0 0 / .05); }
.dark .hm-check { border-color: var(--color-base-700); }
input:checked + .hm-check { background: var(--color-primary-600); border-color: var(--color-primary-600); }
input:checked + .hm-check::after { content: "check_small"; position: absolute; inset: -1px; display: flex; align-items: center; justify-content: center;
      font-family: "Material Symbols Outlined"; font-size: 16px; line-height: 1; color: #fff; }
input:indeterminate + .hm-check { border-color: var(--color-primary-600); background: linear-gradient(var(--color-primary-600), var(--color-primary-600)) center / 8px 2px no-repeat, var(--hm-card); }
input:focus-visible + .hm-check { outline: 2px solid var(--color-primary-600); outline-offset: 2px; }
/* The same box with three states (issue counters): .is-in = checked, .is-out = excluded (red, minus), .is-mixed. */
.hm-check.is-in { background: var(--color-primary-600); border-color: var(--color-primary-600); }
.hm-check.is-in::after, .hm-check.is-out::after { position: absolute; inset: -1px; display: flex; align-items: center; justify-content: center;
      font-family: "Material Symbols Outlined"; font-size: 16px; line-height: 1; color: #fff; }
.hm-check.is-in::after { content: "check_small"; }
.hm-check.is-out { background: var(--color-red-600); border-color: var(--color-red-600); }
.hm-check.is-out::after { content: "remove"; font-size: 14px; }
.hm-check.is-mixed { border-color: var(--color-primary-600); background: linear-gradient(var(--color-primary-600), var(--color-primary-600)) center / 8px 2px no-repeat, var(--hm-card); }
button:focus-visible > .hm-check { outline: 2px solid var(--color-primary-600); outline-offset: 2px; }

/* Multi-select dropdown: panel like Unfold's dropdowns. */
.hm-dd { position: relative; }
.hm-dd-panel { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; width: 300px; max-width: 80vw; padding: 8px; box-sizing: border-box;
      display: flex; flex-direction: column; gap: 6px; background: var(--hm-card); border: 1px solid var(--hm-border); border-radius: var(--hm-radius);
      box-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1); }
/* Opens to the right of its button; flipped by dropdown.js when that would leave the window. */
.hm-dd-panel.is-flipped { left: auto; right: 0; }
.hm-dd-panel--narrow { width: auto; min-width: 180px; }
.dark .hm-dd-panel { background: var(--color-base-800); border-color: var(--color-base-700); }
.hm-dd-panel .hm-input { width: 100%; }
.hm-dd-list { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; }
/* position: the hidden (sr-only, absolute) input stays inside its row; anchored to the panel instead, a click focused it
   far below and the browser scrolled the page there. */
.hm-dd-item { position: relative; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--hm-radius); cursor: pointer; }
.hm-dd-item:hover { background: var(--hm-tab-bg); }
/* One-value dropdown: the picked row is marked instead of a checkbox. */
.hm-dd-item:has(input[type=radio]:checked) { background: var(--hm-tab-bg); font-weight: 600; }
.hm-dd-item:has(input[type=radio]:focus-visible) { outline: 2px solid var(--color-primary-600); outline-offset: -2px; }
.hm-dd-item .hm-count { margin-left: auto; font-size: 12px; }

/* --- defect counters ---------------------------------------------------------------------------------------- */
.hm-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.hm-group-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font: inherit; color: inherit; background: none; border: 0; padding: 0; }
.hm-counter { display: flex; align-items: center; gap: 8px; padding: 5px 8px; margin: 0 -8px; border-radius: var(--hm-radius); cursor: pointer; }
.hm-counter + .hm-counter { margin-top: 2px; }
.hm-counter:hover { background: var(--hm-tab-bg); }
.hm-counter.is-active { background: var(--hm-tab-bg); font-weight: 500; }
.hm-counter.is-zero { color: var(--hm-muted); }
.hm-counter b { font-weight: 600; font-variant-numeric: tabular-nums; }
.hm-counter-main { display: flex; flex: 1; min-width: 0; align-items: center; gap: 8px; cursor: pointer; font: inherit; color: inherit; background: none; border: 0; padding: 0; text-align: left; }
.hm-counter-title { flex: 1; min-width: 0; text-align: left; }
.hm-counter.is-excluded { background: var(--hm-tab-bg); }
.hm-counter.is-excluded .hm-counter-title { text-decoration: line-through; color: var(--hm-muted); }
.hm-counter.is-excluded b { color: var(--hm-muted); }
.htmx-request .hm-results, .hm-results.htmx-request { opacity: .55; transition: opacity .15s; }

/* --- data table: Unfold's table plus column rules and resizable columns ------------------------------------ */
.hm-table-wrap { overflow-x: auto; }
.hm-table { width: 100%; border-collapse: collapse; min-width: 900px; }
.hm-table--compact { min-width: 0; }
.hm-table th { position: relative; text-align: left; font-weight: 600; white-space: nowrap; padding: 8px 12px;
      color: var(--color-font-important-light); background: var(--hm-soft); border-bottom: 1px solid var(--hm-border); }
.dark .hm-table th { color: var(--color-font-important-dark); }
.hm-table td { padding: 8px 12px; border-bottom: 1px solid var(--hm-border); vertical-align: top; }
.hm-table :is(th, td) + :is(th, td) { border-left: 1px solid var(--hm-border); }
.hm-table tr:last-child td { border-bottom: 0; }
.hm-table tbody tr:hover { background: var(--hm-soft); }
.hm-table .hm-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hm-table .hm-empty { padding: 24px; text-align: center; color: var(--hm-muted); }
.hm-table tbody tr:has(.hm-empty):hover { background: none; }
.hm-nowrap { white-space: nowrap; }
.hm-col-main { width: 30%; min-width: 240px; }
.hm-col-actions { width: 1%; white-space: nowrap; }
.hm-col-actions .hm-row { flex-wrap: nowrap; justify-content: flex-end; gap: 6px; }
/* The whole cell is the checkbox's click target. */
.hm-table .hm-pick-cell { width: 40px; padding: 0; position: relative; }
.hm-pick { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.hm-table tbody tr.is-picked { background: var(--hm-tab-bg); }
.hm-thumb-cell { width: 44px; min-width: 44px; }
.hm .hm-thumb { width: 44px; min-width: 44px; height: auto; max-width: none; border-radius: var(--hm-radius); display: block; }
.hm div.hm-thumb { height: 56px; background: var(--hm-tab-bg); } /* no photo */
.hm-title { font-weight: 600; text-decoration: none; color: var(--color-font-important-light); }
.dark .hm-title { color: var(--color-font-important-dark); }
.hm-title:hover { text-decoration: underline; }
.hm-chips { display: flex; flex-wrap: wrap; gap: 4px; }
/* Active filters above the results: one chip per value, a click drops it. */
.hm-active-filters { gap: 8px; }
.hm-filter-chip { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 6px 0 10px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--hm-border); border-radius: var(--border-radius); background: var(--hm-soft); }
.hm-filter-chip:hover { border-color: var(--hm-muted); }
.hm-filter-chip .material-symbols-outlined { font-size: 16px; color: var(--hm-muted); }
.hm-pages { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 12px; border-top: 1px solid var(--hm-border); }

/* Resizable columns (static/hm/table.js): the layout is frozen in px once the script has measured it. */
.hm-table.is-sized { table-layout: fixed; min-width: 0; }  /* width set by table.js; the last column takes the rest */
.hm-table.is-sized td { overflow: hidden; overflow-wrap: anywhere; }
.hm-table.is-sized th { overflow: hidden; text-overflow: ellipsis; }
.hm-resize { position: absolute; top: 0; right: 0; bottom: 0; width: 7px; z-index: 1; cursor: col-resize; touch-action: none; }
.hm-resize:hover, .is-resizing .hm-resize:active { background: linear-gradient(var(--color-primary-600), var(--color-primary-600)) center / 2px 100% no-repeat; }
.hm-table.is-resizing { user-select: none; cursor: col-resize; }

/* --- bulk bar and dialog ------------------------------------------------------------------------------------ */
.hm-bulkbar { position: sticky; bottom: 12px; z-index: 15; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 8px 12px;
      background: var(--hm-card); border: 1px solid var(--hm-border); border-radius: var(--hm-radius);
      box-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1); }
.dark .hm-bulkbar { background: var(--color-base-800); border-color: var(--color-base-700); }
.hm-dialog { width: min(480px, calc(100vw - 32px)); box-sizing: border-box; padding: 0; color: inherit; background: var(--hm-card);
      border: 1px solid var(--hm-border); border-radius: var(--hm-radius); box-shadow: 0 10px 15px -3px rgb(0 0 0 / .1); }
.dark .hm-dialog { --hm-border: var(--color-base-700); --hm-card: var(--color-base-800); background: var(--color-base-800); border-color: var(--color-base-700); }
.hm-dialog::backdrop { background: rgb(24 24 27 / .2); backdrop-filter: blur(4px); }
/* Structure: <dialog class="hm-dialog"> [<form>] .hm-dialog-head / .hm-dialog-body / .hm-dialog-foot — the form is optional. */
.hm-dialog-head, .hm-dialog-foot { display: flex; gap: 8px; align-items: center; padding: 12px 16px; }
.hm-dialog-head { flex-direction: column; align-items: flex-start; gap: 2px; border-bottom: 1px solid var(--hm-border); }
.hm-dialog-body { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.hm-dialog-foot { justify-content: space-between; border-top: 1px solid var(--hm-border); }
.hm-dialog fieldset { border: 0; margin: 0; padding: 0; min-width: 0; gap: 8px; }
.hm-dialog legend { padding: 0; margin-bottom: 8px; }
.hm-dialog p { margin: 0; }
.hm-dialog--wide { width: min(720px, calc(100vw - 32px)); }
/* Bulk edit: one block per field, "where it is now -> becomes" side by side (stacked on a phone). */
.hm-bulk-field { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--hm-border); border-radius: var(--hm-radius); }
.hm-bulk-rule { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px 12px; align-items: end; }
.hm-bulk-rule > [aria-hidden] { padding-bottom: 8px; }
.hm-bulk-tail { order: 100; }
.hm-bulk-rule:has(.hm-bulk-bool) { align-items: center; }
.hm-bulk-rule:has(.hm-bulk-bool) > [aria-hidden] { padding-bottom: 0; }
.hm-bulk-side { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hm-bulk-side .hm-select, .hm-bulk-side .hm-dd, .hm-bulk-side .hm-control { width: 100%; }
@media (max-width: 640px) { .hm-bulk-rule { grid-template-columns: 1fr; } .hm-bulk-rule > [aria-hidden] { display: none; } }
.hm-bulk-examples { display: grid; grid-template-columns: auto auto 1fr; gap: 4px 12px; margin: 0; }
.hm-bulk-examples dd { margin: 0; }

/* --- product card ------------------------------------------------------------------------------------------- */
.hm-text { white-space: pre-wrap; background: var(--hm-soft); border: 1px solid var(--hm-border); border-radius: var(--hm-radius); padding: 8px 12px; min-height: 38px; box-sizing: border-box; }
.hm-text--empty { color: var(--hm-muted); }
.hm-dl { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 8px 12px; margin: 0; }
.hm-dl dt { color: var(--hm-muted); }
.hm-dl dd { margin: 0; overflow-wrap: anywhere; }
.hm-dl--form { align-items: center; }
.hm-dl--form dt:has(+ .hm-dd-inline) { align-self: start; padding-top: 9px; } /* an open inline list grows the row */
/* Product page: the main photo alone on the right, for the look. */
.hm-photo-hero { display: block; padding: 8px; }
.hm-photo-hero img { width: 100%; height: auto; display: block; border-radius: var(--hm-radius); }

/* Photo editing: a grid of draggable slots; the main one framed, hidden ones faded, new or replaced ones marked. */
.hm-photo-edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; list-style: none; margin: 0; padding: 0; }
.hm-photo-slot { display: flex; flex-direction: column; gap: 6px; padding: 6px; border: 2px solid transparent; border-radius: var(--hm-radius); background: var(--hm-tab-bg); cursor: grab; }
.hm-photo-slot img { width: 100%; height: auto; display: block; border-radius: calc(var(--hm-radius) - 2px); pointer-events: none; }
.hm-photo-slot.is-main { border-color: var(--color-primary-600); }
.hm-photo-slot.is-disabled img { opacity: .35; }
.hm-photo-slot.is-dragged { opacity: .4; }
.hm-photo-slot.is-new, .hm-photo-slot.is-replaced { border-style: dashed; }

/* Related products form of the product page (sidebar). */
.hm-related-edit { padding: 0 12px 12px; }
.hm-related-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.hm-related-item { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.hm-related-n { min-width: 16px; text-align: right; }
.hm-related-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hm-related-item button:disabled { opacity: .3; cursor: default; }
.hm-related-search { width: 100%; }
.hm-related-edit .hm-dd-panel { position: static; width: auto; max-width: none; margin-top: 4px; } /* the panel clips */
.hm-dd-inline .hm-dd-panel { position: static; width: 300px; max-width: 100%; margin-top: 4px; } /* last in a card: it clips */
button.hm-dd-item { width: 100%; border: 0; background: none; font: inherit; color: inherit; text-align: left; }
button.hm-dd-item:disabled { cursor: default; opacity: .5; }
.hm-photo-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.hm-photo-file { position: relative; cursor: pointer; }
.hm-photo-actions { display: inline-flex; align-items: center; margin-left: auto; }

/* A gallery change in the history: before, then after; new files framed, removed ones crossed out (faded). */
.hm-photo-diff { display: flex; flex-direction: column; gap: 4px; }
.hm-photo-diff img { width: 48px; height: auto; border-radius: 4px; border: 2px solid transparent; box-sizing: border-box; }
.hm-photo-diff img.is-main { border-color: var(--color-primary-600); }
.hm-photo-diff img.is-new { border-style: dashed; border-color: var(--color-green-600, #16a34a); }
.hm-photo-diff img.is-gone, .hm-photo-diff img.is-disabled { opacity: .35; }

/* Folding blocks (hmFold): the title row alone, its bottom border and gap gone; the arrow turns. */
.hm-fold.is-folded > div > div:first-child { margin-bottom: -24px; border-bottom-color: transparent; }
.hm-fold .hm-fold-btn .material-symbols-outlined { transition: transform .15s; margin: 0; }
.hm-fold.is-folded .hm-fold-btn .material-symbols-outlined { transform: rotate(180deg); }
.hm-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; }
.hm-panel.is-folded .hm-panel-head { padding-bottom: 8px; }

.hm-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; align-items: start; }
.hm-gallery figure { margin: 0; display: flex; flex-direction: column; gap: 4px; }
/* The photo's own proportions: the frame (main photo) follows it. */
.hm-gallery img { width: 100%; height: auto; display: block; border-radius: var(--hm-radius); border: 2px solid transparent; box-sizing: border-box; }
.hm-gallery .is-main img { border-color: var(--color-primary-600); }
.hm-gallery .is-disabled img { opacity: .35; }
.hm-issue { display: flex; gap: 12px; align-items: center; }
.hm-issue > :first-child { flex: none; }

/* --- brands ------------------------------------------------------------------------------------------------- */
.hm-brand-item { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--hm-border); }
.hm-brand-item:first-child { border-top: 0; padding-top: 0; }
.hm-brand-item .hm-input { width: 220px; }
/* Unmapped spelling: suggestions | another brand | new brand, the last two aligned in columns across items. */
.hm-brand-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 24px; align-items: center; }
@media (max-width: 1280px) { .hm-brand-actions { grid-template-columns: auto auto; justify-content: start; } .hm-brand-actions > :first-child { grid-column: 1 / -1; } }
.hm-table .hm-input--inline { min-height: 32px; padding: 4px 8px; width: 100%; max-width: 280px; }
.hm-col-actions .hm-input--inline { width: 220px; }
.hm-alias { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 4px 0; border-top: 1px dashed var(--hm-border); }
.hm-alias:first-child { border-top: 0; padding-top: 0; }
.hm-alias form { margin-left: auto; }

/* --- import ------------------------------------------------------------------------------------------------- */
.hm-file-name { font: inherit; color: inherit; background: none; border: 0; padding: 0; min-width: 0; flex: 0 1 260px; text-overflow: ellipsis; }
.hm-file-name:focus { outline: none; }
.hm-file-name::placeholder { color: var(--hm-muted); opacity: 1; }
.hm-change + .hm-change { border-top: 1px dashed var(--hm-border); padding-top: 4px; margin-top: 4px; }
.hm-change summary { cursor: pointer; }
.hm-change details .hm-two { margin-top: 6px; }
.hm-pages .hm-row { gap: 2px; }
.hm-pages .hm-pages-tail { gap: 16px; }
.hm-pages .material-symbols-outlined { font-size: 18px; }
.hm-page-input { width: 80px; min-height: 32px; padding: 4px 8px; }

/* "Настроить" panel of the product list: columns | filters side by side. */
.hm-prefs { width: 440px; gap: 12px; }
.hm-prefs-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-height: min(55vh, 520px); overflow-y: auto; }
.hm-prefs fieldset { border: 0; margin: 0; padding: 0; min-width: 0; max-height: none; overflow: visible; }
.hm-prefs legend { padding: 0 8px 6px; }
