/* Arbetsmiljöskylt widget. Scoped to .am.
   Follows the shop (Empire): Lato body, Jost headings, the theme blue, 3 px
   corners. Flat: rules and space between sections, no boxed cards; the sign
   preview and the buy button carry the page. */
.am {
  container: am / inline-size;
  --am-accent: #007bff;
  --am-ink: #2e3238;
  --am-muted: #6c7178;
  --am-line: #e3e5e8;
  --am-line-strong: #c9cdd2;
  --am-soft: #f5f6f7;
  --am-pick: color-mix(in oklab, var(--am-accent) 6%, #fff);
  --am-radius: 3px;
  --am-head: Jost, var(--am-body, inherit);
  color: var(--am-ink);
  font-size: 15px;
  line-height: 1.5;
  margin: 8px 0 28px;
  -webkit-font-smoothing: antialiased;
}
.am *, .am *::before, .am *::after { box-sizing: border-box; }
.am :where(button, input, textarea) { font: inherit; color: inherit; }
.am [hidden] { display: none !important; }
.am-muted { color: var(--am-muted); }
.am-small { font-size: 13px; margin: 6px 0 0; }

/* preview */
.am-preview { margin: 0 0 16px; }
.am-stage {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 4 / 3; max-height: 460px; width: 100%;
  padding: 7%;
  background: var(--am-soft);
}
.am-preview-img { max-width: 100%; max-height: 100%; display: block; filter: drop-shadow(0 1px 2px rgb(30 35 45 / .18)) drop-shadow(0 8px 18px rgb(30 35 45 / .12)); }
.am-preview-meta { margin-top: 8px; font-size: 13px; color: var(--am-muted); }
.am-preview-meta strong { color: var(--am-ink); font-weight: 600; }
.am-preview-host .am-stage { aspect-ratio: auto; min-height: 300px; max-height: none; padding: 9%; }
.am-preview-host > [data-am-hidden] { display: none !important; }

.am-title { font-family: var(--am-head); font-size: 28px; line-height: 1.2; margin: 0 0 4px; font-weight: 700; }
.am-price { font-family: var(--am-head); font-size: 24px; font-weight: 600; margin: 0 0 18px; min-height: 1.3em; letter-spacing: -.01em; }

/* Empire product row (gallery | details | theme buy form): the theme form is
   hidden, so its column goes to the widget. Wide sign stage left (7/12) that
   stays in view, one flowing configurator right (5/12). */
@media (min-width: 1000px) {
  .am-page.product--outer { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); column-gap: clamp(32px, 4vw, 64px); align-items: start; }
  .am-page > .product-form--alt { display: none !important; }
  .am-page > .product-gallery, .am-page > .product-main { width: auto !important; max-width: none !important; margin-left: 0 !important; margin-right: 0 !important; padding-left: 0; padding-right: 0; }
  .am-page > .product-gallery { position: sticky; top: var(--am-sticky-top, 16px); transition: top .2s cubic-bezier(.22, 1, .36, 1); }
  /* sign + toolbar + spec line fit the window below the header */
  .am-preview-host .am-stage { min-height: 0; height: clamp(320px, calc(100vh - var(--am-sticky-top, 16px) - 200px), 520px); }
}
.am-preview.am { margin: 0 0 16px; }

/* The theme's product description under the configurator: same type and
   rhythm as the widget instead of a loose 16px paragraph. */
.am-page .product-description { --am-ink: #2e3238; --am-muted: #6c7178; --am-line: #e3e5e8; --am-accent: #007bff; margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--am-line); font-size: 15px; line-height: 1.6; color: var(--am-ink); max-width: 64ch; }
.am-page .product-description > :first-child { margin-top: 0; }
.am-page .product-description h2 { font-family: Jost, inherit; font-size: 22px; font-weight: 600; line-height: 1.25; margin: 0 0 10px; }
.am-page .product-description h3 { font-family: Jost, inherit; font-size: 16px; font-weight: 600; margin: 28px 0 10px; }
.am-page .product-description p { margin: 0 0 12px; }
.am-page .product-description ol { list-style: none; counter-reset: am-step; margin: 0 0 14px; padding: 0; }
.am-page .product-description ol li { counter-increment: am-step; position: relative; padding: 0 0 8px 28px; }
.am-page .product-description ol li::before { content: counter(am-step); position: absolute; left: 0; top: 0; font-family: Jost, inherit; font-weight: 600; color: var(--am-accent); font-variant-numeric: tabular-nums; }
.am-page .product-description ul { list-style: none; margin: 0 0 14px; padding: 0; border-top: 1px solid var(--am-line); }
.am-page .product-description ul li { display: grid; grid-template-columns: 10.5em 1fr; gap: 4px 16px; padding: 9px 0; border-bottom: 1px solid var(--am-line); color: var(--am-muted); }
.am-page .product-description ul li strong { color: var(--am-ink); font-weight: 600; }
.am-page .product-description a { color: var(--am-accent); text-underline-offset: 3px; }
.am-page .product-description p:last-child:has(a) { padding: 12px 14px; background: #f5f6f7; border-radius: 3px; }
@media (max-width: 640px) {
  .am-page .product-description ul li { grid-template-columns: 1fr; gap: 0; }
}

/* toolbar on the preview: category + layout */
.am-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 10px; }
.am-cat { position: relative; }
.am-cat-btn { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--am-line-strong); border-radius: var(--am-radius); background: #fff; cursor: pointer; font-size: 14px; }
.am-cat-btn:hover { border-color: var(--am-ink); }
.am-cat-btn[aria-expanded="true"] .am-chev { transform: rotate(180deg); }
.am-cat-menu { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 240px; padding: 4px; background: #fff; border: 1px solid var(--am-line-strong); border-radius: var(--am-radius); box-shadow: 0 8px 24px rgb(30 35 45 / .12); }
.am-cat-menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border: 0; background: none; cursor: pointer; text-align: left; font-size: 14px; border-radius: var(--am-radius); }
.am-cat-menu button:hover { background: var(--am-soft); }
.am-cat-menu button[aria-selected="true"] { font-weight: 600; background: var(--am-pick); }
.am-seg { display: inline-flex; flex-wrap: nowrap; overflow-x: auto; border: 1px solid var(--am-line-strong); border-radius: var(--am-radius); background: #fff; max-width: 100%; scrollbar-width: none; }
.am-seg button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 0; border-left: 1px solid var(--am-line); background: none; cursor: pointer; font-size: 13px; color: var(--am-muted); white-space: nowrap; }
.am-seg button:first-child { border-left: 0; }
.am-seg button:hover { color: var(--am-ink); }
.am-seg button[aria-pressed="true"] { color: var(--am-ink); font-weight: 600; background: var(--am-pick); box-shadow: inset 0 -2px 0 var(--am-accent); }
.am-seg-mark { width: 22px; height: 22px; flex: none; }
.am-seg-mark svg { width: 100%; height: 100%; }

/* spec line under the sign */
.am-spec { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 10px 0 0; font-size: 13px; color: var(--am-muted); font-variant-numeric: tabular-nums; }
.am-spec strong { color: var(--am-ink); font-weight: 600; }
.am-dot { color: var(--am-line-strong); }

/* configurator: one flow of two sections */
.am-section { padding: 18px 0 6px; border-top: 1px solid var(--am-line); }
.am-section-title { font-family: var(--am-head); font-size: 18px; font-weight: 600; margin: 0 0 12px; color: var(--am-ink); }
.am-field-group { margin: 0 0 18px; }
.am-field-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.am-field-label { font-size: 14px; font-weight: 600; }
.am-field-head .am-muted { font-size: 13px; }
.am-buybar { position: sticky; bottom: 0; z-index: 5; margin-top: 8px; padding: 14px 0 12px; background: #fff; border-top: 1px solid var(--am-line); }
.am-buybar .am-advanced { margin-top: 6px; padding-top: 0; border-top: 0; }

/* category / layout: spec-sheet rows */
.am-rows { border-top: 1px solid var(--am-line); margin-bottom: 8px; }
.am-row { border-bottom: 1px solid var(--am-line); }
.am-summary { display: grid; grid-template-columns: 6.2em 1fr auto; align-items: center; gap: 12px; width: 100%; padding: 12px 0; border: 0; background: none; cursor: pointer; text-align: left; }
.am-summary:focus-visible { outline: 2px solid var(--am-accent); outline-offset: 2px; }
.am-summary-label { font-size: 13px; color: var(--am-muted); }
.am-summary-value { font-weight: 600; min-width: 0; }
.am-summary-value .am-muted { font-weight: 400; }
.am-summary-action { display: inline-flex; align-items: center; gap: 4px; color: var(--am-accent); font-size: 14px; }
.am-summary:hover .am-summary-action { text-decoration: underline; text-underline-offset: 3px; }
.am-summary[aria-expanded="true"] .am-chev { transform: rotate(180deg); }
.am-chev { display: inline-flex; transition: transform .2s cubic-bezier(.22, 1, .36, 1); }
.am-inline { display: inline-flex; align-items: center; gap: 8px; }
.am-mark { display: inline-flex; width: 20px; height: 20px; flex: none; }
.am-mark svg { width: 100%; height: 100%; }
.am-info { margin: 0 0 12px; font-size: 14px; color: var(--am-muted); }

.am-step-head { display: flex; align-items: baseline; gap: 10px; margin: 26px 0 10px; }
.am-step-label { font-family: var(--am-head); font-size: 17px; font-weight: 600; margin: 0; color: var(--am-ink); letter-spacing: 0; }
.am-step-head .am-muted { font-size: 13px; }

/* options */
.am-grid { display: grid; gap: 6px; }
.am-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.am-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.am-option { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 9px 11px; border: 1px solid var(--am-line-strong); border-radius: var(--am-radius); background: #fff; cursor: pointer; text-align: left; min-height: 46px; transition: border-color .15s; }
.am-option:hover:not(:disabled) { border-color: var(--am-ink); }
.am-option[aria-pressed="true"] { border-color: var(--am-accent); box-shadow: inset 0 0 0 1px var(--am-accent); background: var(--am-pick); }
.am-option:disabled { cursor: not-allowed; color: #a3a8ae; border-style: dashed; }
.am-option strong { font-weight: 600; font-size: 14px; }
.am-option small { color: var(--am-muted); font-size: 12px; line-height: 1.3; }
.am-option:disabled small { color: #a3a8ae; }
.am-option-row { flex-direction: row; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.am-layout { align-items: center; text-align: center; padding: 8px 4px; }
.am-layout-mark { width: 38px; height: 38px; }
.am-layout-mark svg { width: 100%; height: 100%; }
.am-layout strong { font-size: 13px; }
.am-layout small { font-size: 11px; }

.am-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.am-chip { padding: 8px 13px; border: 1px solid var(--am-line-strong); border-radius: var(--am-radius); background: #fff; cursor: pointer; font-size: 14px; font-variant-numeric: tabular-nums; transition: border-color .15s; }
.am-chip:hover { border-color: var(--am-ink); }
.am-chip[aria-pressed="true"] { border-color: var(--am-accent); box-shadow: inset 0 0 0 1px var(--am-accent); background: var(--am-pick); font-weight: 600; }

.am-custom { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.am-field { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.am-field input { width: 84px; padding: 8px 10px; border: 1px solid var(--am-line-strong); border-radius: var(--am-radius); background: #fff; font-variant-numeric: tabular-nums; }
.am-times { color: var(--am-muted); }

/* symbol */
.am-selected { display: flex; align-items: center; gap: 12px; }
.am-selected-img { width: 44px; height: 44px; object-fit: contain; flex: none; }
.am-selected-img.am-empty { border: 1px dashed var(--am-line-strong); }
.am-selected-text { flex: 1; display: flex; flex-direction: column; min-width: 0; font-weight: 600; }
.am-selected-text small { font-weight: 400; color: var(--am-muted); font-size: 13px; }
.am-textlink { padding: 0; border: 0; background: none; color: var(--am-accent); cursor: pointer; font-size: 14px; text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--am-accent) 35%, transparent); text-underline-offset: 3px; }
.am-textlink:hover { text-decoration-color: currentColor; }
.am-textlink:disabled { color: var(--am-muted); cursor: progress; }
.am-picker { margin-top: 14px; }
.am-symbol .am-picker { margin-top: 0; }
.am .am-showall { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px; border: 1px solid var(--am-accent); border-radius: var(--am-radius); background: var(--am-pick); color: var(--am-accent); font-weight: 600; font-size: 14px; cursor: pointer; transition: background-color .15s, color .15s; }
.am .am-showall:hover { background: var(--am-accent); color: #fff; }
.am .am-showall:focus-visible { outline: 2px solid var(--am-accent); outline-offset: 2px; }
.am-search { display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--am-line-strong); border-radius: var(--am-radius); background: #fff; color: var(--am-muted); }
.am-search input { flex: 1; border: 0; padding: 9px 0; outline: none; min-width: 0; background: transparent; }
.am-search:focus-within { border-color: var(--am-accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--am-accent) 15%, transparent); }
.am-tabs { display: flex; align-items: flex-end; gap: 18px; margin-top: 12px; border-bottom: 1px solid var(--am-line); }
.am-tabs button { border: 0; background: none; padding: 7px 0; cursor: pointer; color: var(--am-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 14px; }
.am-tabs button[aria-selected="true"] { color: var(--am-ink); font-weight: 600; border-bottom-color: var(--am-ink); }
.am-count { margin-left: auto; padding-bottom: 8px; font-size: 12px; color: var(--am-muted); font-variant-numeric: tabular-nums; }
.am-chips-small { gap: 2px 14px; margin: 10px 0 2px; }
.am-chips-small .am-chip { padding: 2px 0; border: 0; background: none; box-shadow: none; color: var(--am-muted); font-size: 13px; border-radius: 0; }
.am-chips-small .am-chip[aria-pressed="true"] { color: var(--am-ink); font-weight: 600; background: none; box-shadow: none; text-decoration: underline; text-underline-offset: 4px; }
.am-symbol-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 4px; margin-top: 10px; }
.am-symbol-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px 8px; border: 1px solid transparent; border-radius: var(--am-radius); background: none; cursor: pointer; text-align: center; font-size: 12px; line-height: 1.25; color: var(--am-ink); }
.am-symbol-tile:hover { background: var(--am-soft); }
.am-symbol-tile img { width: 52px; height: 52px; object-fit: contain; }
.am-symbol-tile[aria-pressed="true"] { border-color: var(--am-accent); box-shadow: inset 0 0 0 1px var(--am-accent); background: var(--am-pick); }
.am-picker-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin-top: 12px; }
.am-upload { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--am-accent); }
.am-upload small { font-size: 12px; }
.am-upload:focus-within { outline: 2px solid var(--am-accent); outline-offset: 2px; }

/* text */
.am-label { display: block; font-size: 13px; color: var(--am-muted); margin: 8px 0 4px; }
.am-text textarea { width: 100%; min-height: 64px; padding: 10px 12px; border: 1px solid var(--am-line-strong); border-radius: var(--am-radius); resize: vertical; background: #fff; line-height: 1.4; }
.am-text textarea:focus, .am-field input:focus { outline: none; border-color: var(--am-accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--am-accent) 15%, transparent); }

/* buy */
.am-sep { border-top: 1px solid var(--am-line); margin: 28px 0 16px; }
.am-buy { display: flex; gap: 8px; align-items: stretch; }
.am-qty { display: flex; align-items: center; border: 1px solid var(--am-line-strong); border-radius: var(--am-radius); background: #fff; }
.am-qty button { width: 36px; align-self: stretch; border: 0; background: none; cursor: pointer; font-size: 18px; color: var(--am-ink); }
.am-qty input { width: 40px; border: 0; text-align: center; -moz-appearance: textfield; background: transparent; font-variant-numeric: tabular-nums; }
.am-qty input::-webkit-outer-spin-button, .am-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.am .am-primary { flex: 1; min-height: 50px; padding: 12px 18px; border: 0; border-radius: var(--am-radius); background: var(--am-accent); color: #fff; font-weight: 700; font-size: 16px; cursor: pointer; font-variant-numeric: tabular-nums; transition: background-color .15s; }
.am .am-primary:hover:not(:disabled) { background: color-mix(in oklab, var(--am-accent) 86%, #000); }
.am .am-primary:disabled { background: color-mix(in oklab, var(--am-accent) 40%, #fff); cursor: not-allowed; }
.am-advanced { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--am-line); font-size: 14px; }
.am-advanced p { margin: 0; }
.am .am-secondary { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 44px; padding: 10px 16px; border: 1px solid var(--am-accent); border-radius: var(--am-radius); background: #fff; color: var(--am-accent); font-weight: 600; font-size: 15px; cursor: pointer; transition: background-color .15s; }
.am .am-secondary:hover:not(:disabled) { background: var(--am-pick); }
.am .am-secondary:disabled { color: var(--am-muted); border-color: var(--am-line-strong); cursor: progress; }
.am-advanced .am-small { margin-top: 0; }
.am .am-adv-btn { width: auto; flex: 0 0 auto; min-height: 50px; padding: 10px 14px; font-size: 14px; white-space: nowrap; }
.am-buy .am-add { white-space: nowrap; padding-left: 14px; padding-right: 14px; }
/* Narrow column: quantity + cart on one row, advanced mode full width under it;
   the text size goes under the field. */
.am-buybar, .am-text { container-type: inline-size; }
@container (max-width: 500px) {
  .am-buybar .am-buy { flex-wrap: wrap; }
  .am .am-adv-btn { order: 3; flex: 1 1 100%; min-height: 44px; }
}
@container (max-width: 440px) {
  .am-text .am-text-fields { max-width: none; flex-basis: 100%; }
}
.am-msg { margin: 0 0 10px; padding: 9px 12px; border-left: 3px solid var(--am-line-strong); font-size: 14px; background: var(--am-soft); }
.am-msg[data-tone="error"] { border-left-color: #c62828; background: #fdf2f2; color: #8a1c1c; }
.am-msg[data-tone="warn"] { border-left-color: #b7791f; background: #fff8e6; color: #6b4b00; }
.am-msg[data-tone="ok"] { border-left-color: #2e7d32; background: #eef7ef; color: #1d5221; }
.am-msg a { color: inherit; font-weight: 700; }

/* modal (the full symbol library) */
.am-modal { position: fixed; inset: 0; z-index: 2147483000; background: rgb(20 24 31 / .5); display: flex; align-items: center; justify-content: center; padding: 16px; }
.am-modal-box { width: min(920px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: var(--am-radius); margin: 0; }
.am-modal-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: #fff; border-bottom: 1px solid var(--am-line); font-family: var(--am-head); font-size: 17px; }
.am-icon-btn { display: inline-flex; padding: 6px; border: 0; background: none; cursor: pointer; border-radius: var(--am-radius); }
.am-icon-btn:hover { background: var(--am-soft); }
.am-picker-big { padding: 16px 18px 20px; margin: 0; }
.am-picker-big .am-symbol-grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); }
.am-picker-big .am-symbol-tile img { width: 64px; height: 64px; }

@media (max-width: 640px) {
  .am-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .am-grid-3 > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .am-grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .am-summary { grid-template-columns: 1fr auto; }
  .am-summary-label { grid-column: 1 / -1; margin-bottom: -10px; }
  .am-buybar .am-buy { flex-wrap: wrap; }
  .am-qty { flex: none; }
}
@media (prefers-reduced-motion: reduce) {
  .am *, .am *::before, .am *::after { transition: none !important; }
}

/* Textstorlek − 23 mm + Auto (Sixten) */
.am-text-hint { margin: -6px 0 8px; }
.am-text-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.am-text-fields { flex: 1 1 240px; max-width: 60%; min-width: 0; }
.am-textsize { display: flex; align-items: center; gap: 8px; flex: none; font-size: 14px; }
.am-ts-btn { width: 32px; height: 32px; padding: 0; border: 1px solid var(--am-line-strong); border-radius: var(--am-radius); background: #fff; color: var(--am-ink, #1f2328); font-size: 18px; line-height: 1; cursor: pointer; }
.am-ts-btn:hover:not(:disabled) { background: #f5f6f7; }
.am-ts-btn:disabled { opacity: .4; cursor: default; }
.am-ts-val { min-width: 4.4em; text-align: center; font-variant-numeric: tabular-nums; }
.am-textsize .am-link { padding: 0; border: 0; background: none; color: var(--am-accent, #007bff); cursor: pointer; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
