.dm-page {
  --dm-ink: #142f58;
  --dm-muted: #526782;
  --dm-paper: #fff;
  --dm-line: #dce6f3;
  --dm-soft: #eef5ff;
  --dm-accent: #1759bd;
  max-width: 1520px;
  margin-inline: auto;
  padding-block: 18px 44px;
  color: var(--dm-ink);
}

html[data-theme="dark"] .dm-page {
  --dm-ink: #eaf2ff;
  --dm-muted: #afc2dc;
  --dm-paper: #172538;
  --dm-line: #344965;
  --dm-soft: #203651;
  --dm-accent: #84b8ff;
}

.dm-page [hidden] { display: none !important; }
.dm-page :is(button, a, input):focus-visible { outline: 2px solid var(--dm-accent); outline-offset: 3px; }
.dm-crumb { display: flex; gap: 9px; padding: 4px 0 14px; font-size: .88rem; color: var(--dm-muted); }
.dm-crumb a, .dm-cart-link { color: var(--dm-accent); }
.dm-hero {
  min-height: 320px;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  align-items: center;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(26px, 4vw, 66px);
  border-radius: 24px;
  color: #f5faff;
  background:
    radial-gradient(ellipse at 81% 12%, #3b73c3, transparent 57%),
    linear-gradient(119deg, #0c2245 8%, #153e79 69%, #21599f);
}
.dm-hero .dm-kicker {
  margin: 0 0 10px;
  color: #c1dafa;
  font-size: .79rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.dm-hero h1 {
  color: #fff;
  font-size: clamp(2.15rem, 5.7vw, 4.9rem);
  font-weight: 800;
  line-height: .99;
  letter-spacing: -.055em;
  margin: 0 0 18px;
  max-width: 10ch;
}
.dm-hero p { color: #e0edff; max-width: 46ch; font-size: 1rem; line-height: 1.55; margin: 0 0 20px; }
.dm-hero-art { position: relative; height: 250px; margin: 0 2% 0 -3%; }
.dm-hero-art span {
  position: absolute;
  display: grid;
  place-items: center;
  width: 54%;
  aspect-ratio: 1.09;
  border: 1px solid #fff;
  border-radius: 12px;
  background: linear-gradient(145deg, #fff, #e6eef8);
  box-shadow: 0 20px 34px #07152c60;
}
.dm-hero-art span:nth-child(1) { top: 13%; left: 0; transform: rotate(-15deg); }
.dm-hero-art span:nth-child(2) { top: 4%; left: 25%; z-index: 2; transform: rotate(6deg); }
.dm-hero-art span:nth-child(3) { top: 28%; left: 52%; transform: rotate(18deg); }
.dm-hero-art img { width: 81%; height: auto; }
.dm-hero-art span, .dm-zoom, .dm-dialog img { color-scheme: light; }
.dm-hero-art img, .dm-zoom img, .dm-dialog img {
  filter: invert(21%) sepia(59%) saturate(1568%) hue-rotate(184deg) brightness(82%) contrast(93%);
}
.dm-page img[data-dm-ink="red"] {
  filter: invert(17%) sepia(92%) saturate(4591%) hue-rotate(347deg) brightness(83%) contrast(89%);
}
.dm-page .dm-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  padding: 10px 17px;
  border: 0;
  border-radius: 10px;
  background: #155bc4;
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.dm-page .dm-button:hover { background: #0f479b; color: #fff; }
.dm-page .dm-hero-button { background: #fff; color: #174077; }
.dm-page .dm-hero-button:hover { background: #d8eaff; color: #103365; }
.dm-config { display: grid; grid-template-columns: minmax(0, 1fr) clamp(308px, 37%, 490px); gap: clamp(15px, 2vw, 28px); margin-top: 28px; align-items: start; }
.dm-gallery, .dm-order { scroll-margin-top: 132px; min-width: 0; }
.dm-gallery h2, .dm-order h2, .dm-dialog h2 { color: var(--dm-ink); font-size: 1.54rem; line-height: 1.15; letter-spacing: -.035em; margin: 0 0 14px; }
.dm-gallery-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 7px 14px; margin-bottom: 12px; }
.dm-gallery-head h2 { margin: 0; }
.dm-gallery { container-type: inline-size; }
.dm-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--dm-line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--dm-soft);
  color: var(--dm-accent);
  font: inherit;
  font-size: .79rem;
  font-weight: 700;
  cursor: pointer;
}
.dm-view-toggle[data-dm-expand]::before { content: '↗'; font-size: 1rem; line-height: 1; }
.dm-filters { display: flex; gap: 7px; flex-wrap: wrap; margin: 0 0 12px; }
.dm-filters button {
  border: 1px solid var(--dm-line);
  background: var(--dm-paper);
  color: var(--dm-ink);
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: .78rem;
  line-height: 1.2;
}
.dm-filters button[aria-pressed="true"] { border-color: var(--dm-accent); background: var(--dm-soft); color: var(--dm-accent); font-weight: 700; }
.dm-filters [data-dm-filter] { display: inline-flex; gap: 5px; align-items: center; }
.dm-filters button[data-dm-filter="fire"] { border-color: #e4a5ae; color: #ae1f2f; background: #fff0f2; }
.dm-filters button[data-dm-filter="fire"][aria-pressed="true"] { border-color: #b51d2a; color: #fff; background: #b51d2a; }
.dm-series { margin-top: 20px; scroll-margin-top: 132px; }
.dm-series-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 9px;
  color: var(--dm-ink);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.24;
}
.dm-series-title::after { content: ''; flex: 1; height: 1px; background: var(--dm-line); }
.dm-series-icon { width: 15px; height: 15px; flex: none; }
.dm-series-emblem {
  display: grid;
  width: 32px;
  height: 32px;
  flex: none;
  place-items: center;
  border: 1px solid var(--dm-line);
  border-radius: 9px;
  background: var(--dm-soft);
  color: var(--dm-accent);
}
.dm-series-emblem .dm-series-icon { width: 20px; height: 20px; }
.dm-series[data-dm-section="fire"] .dm-series-emblem { background: #fff0f2; border-color: #e4a5ae; color: #ae1f2f; }
.dm-series[data-dm-section="pair"] .dm-series-emblem { background: #e6edff; border-color: #cfddfa; color: #2a58aa; }
.dm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(6px, 1vw, 12px); }
@container (min-width: 620px) {
  .dm-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.dm-tile { display: flex; flex-direction: column; min-width: 0; border-radius: 13px; background: var(--dm-paper); overflow: hidden; box-shadow: 0 4px 15px #0a28520c; }
.dm-tile:has(input:checked) { box-shadow: inset 0 0 0 2px var(--dm-accent); }
.dm-zoom { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1; background: #fff; border: 0; cursor: zoom-in; }
.dm-zoom:focus-visible { outline-offset: -3px !important; }
.dm-zoom img { width: 78%; height: auto; }
.dm-zoom span { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #ebf2fd; color: #193a67; font-size: 1rem; }
.dm-choice { display: flex; flex: 1; flex-direction: column; gap: 4px; padding: 9px 8px; cursor: pointer; text-align: center; }
.dm-choice-code { font-size: .68rem; font-weight: 600; color: var(--dm-muted); }
.dm-choice strong { display: block; min-height: 2.4em; font-size: .81rem; line-height: 1.2; font-weight: 700; overflow-wrap: anywhere; color: var(--dm-ink); }
.dm-choice input, .dm-terms input, .dm-mount input { position: absolute; width: 1px; height: 1px; padding: 0; opacity: 0; }
.dm-choice:has(input:focus-visible), .dm-terms label:has(input:focus-visible), .dm-mount:has(input:focus-visible) { outline: 2px solid var(--dm-accent); outline-offset: -2px; }
.dm-pick { display: block; margin-top: auto; padding: 6px 3px; background: var(--dm-soft); border-radius: 7px; color: var(--dm-accent); font-size: .76rem; font-weight: 700; }
.dm-pick span:nth-child(2), .dm-choice input:checked ~ .dm-pick span:nth-child(1) { display: none; }
.dm-choice input:checked ~ .dm-pick span:nth-child(2) { display: inline; }
.dm-to-mount { display: none; }
.dm-order { position: sticky; top: 108px; max-height: calc(100dvh - 125px); overflow-y: auto; scrollbar-width: thin; border-radius: 16px; padding: 16px; border: 1px solid var(--dm-line); background: var(--dm-paper); }
.dm-order h2 { margin-bottom: 5px; }
.dm-order-selection { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.dm-selection { margin: 0; color: var(--dm-muted); font-size: .82rem; }
.dm-order-paper { display: grid; flex: 0 0 57px; height: 57px; place-items: center; background: #fff; border: 1px solid var(--dm-line); border-radius: 7px; }
#dm-order-preview {
  width: 44px;
  height: 44px;
  background: var(--dm-print-color);
  -webkit-mask: var(--dm-print-art) center / contain no-repeat;
  mask: var(--dm-print-art) center / contain no-repeat;
}
.dm-order fieldset { min-width: 0; padding: 0; margin: 0 0 13px; border: 0; }
.dm-order legend { margin: 0 0 7px; font-size: .92rem; font-weight: 700; color: var(--dm-ink); }
.dm-terms { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; }
.dm-terms label, .dm-mount, .dm-color {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6px 3px;
  color: var(--dm-ink);
  background: var(--dm-paper);
  border: 1px solid var(--dm-line);
  border-radius: 8px;
  min-width: 0;
  cursor: pointer;
}
.dm-terms label:has(input:checked), .dm-mount:has(input:checked), .dm-color:has(input:checked) { border-color: var(--dm-accent); background: var(--dm-soft); }
.dm-terms span, .dm-mount span { font-size: .71rem; line-height: 1.25; overflow-wrap: anywhere; }
.dm-terms strong, .dm-mount strong { color: var(--dm-accent); font-size: .75rem; margin-top: 3px; }
.dm-colors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.dm-color { flex-direction: row; justify-content: flex-start; gap: 5px; padding: 7px 6px; font-size: .73rem; }
.dm-color input { position: absolute; width: 1px; height: 1px; padding: 0; opacity: 0; }
.dm-color:has(input:focus-visible) { outline: 2px solid var(--dm-accent); outline-offset: -2px; }
.dm-color i { width: 10px; height: 10px; flex: none; background: var(--swatch); border-radius: 50%; }
.dm-color strong { white-space: nowrap; margin-left: auto; color: var(--dm-accent); font-size: .68rem; }
.dm-color-note { margin-top: 5px !important; margin-bottom: 0 !important; }
.dm-mount-filters { gap: 4px; margin-bottom: 7px; }
.dm-mount-filters button { padding: 5px 6px; font-size: .72rem; }
.dm-mount-controls { display: flex; justify-content: flex-end; gap: 5px; margin: 0 0 5px; }
.dm-mount-controls button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 34px;
  border: 1px solid var(--dm-line);
  border-radius: 8px;
  padding: 0 0 2px;
  background: var(--dm-soft);
  color: var(--dm-accent);
  font: 700 1.4rem/1 sans-serif;
  cursor: pointer;
}
.dm-mount-controls button:disabled { cursor: default; opacity: .45; }
.dm-mount-grid {
  display: flex;
  gap: 7px;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  padding: 0 0 4px;
}
.dm-mount-grid:focus-visible { outline: 2px solid var(--dm-accent); outline-offset: 2px; }
.dm-mount-grid .dm-mount {
  flex: 0 0 max(96px, calc((100% - 14px) / 3));
  box-sizing: border-box;
  scroll-snap-align: start;
  overflow-wrap: anywhere;
}
.dm-mount img { width: min(86px, 100%); height: 52px; object-fit: contain; background: #fff; border-radius: 4px; margin-bottom: 4px; }
.dm-extra, .dm-quantity, .dm-total { display: flex; gap: 7px; align-items: center; margin: 0 0 8px; font-size: .81rem; color: var(--dm-ink); }
.dm-extra { cursor: pointer; font-size: .75rem; }
.dm-extra strong, .dm-quantity input, .dm-total strong { margin-left: auto; }
.dm-quantity input { width: 64px; height: 32px; border: 1px solid var(--dm-line); border-radius: 7px; color: var(--dm-ink); background: var(--dm-paper); padding: 2px 6px; font: inherit; }
.dm-total { border-top: 1px solid var(--dm-line); padding-top: 7px; margin-bottom: 4px; font-weight: 700; }
.dm-total strong { font-size: 1.28rem; line-height: 1.3; color: var(--dm-accent); }
.dm-note, .dm-error { font-size: .75rem; margin: 3px 0 9px; color: var(--dm-muted); }
.dm-error { margin-top: 7px; color: #b33726; }
html[data-theme="dark"] .dm-error { color: #ffad9d; }
.dm-add, .dm-cart-link { width: 100%; text-align: center; }
.dm-cart-link { display: block; font-weight: 700; padding-top: 8px; font-size: .85rem; }
.dm-dialog { max-width: min(480px, 92vw); padding: 20px; color: var(--dm-ink); background: var(--dm-paper); text-align: center; border: 1px solid var(--dm-line); border-radius: 15px; box-shadow: 0 20px 80px #06112379; }
.dm-dialog::backdrop { background: #0b1b37b0; }
.dm-dialog img { display: block; box-sizing: border-box; max-width: 100%; max-height: 57vh; height: auto; object-fit: contain; padding: 13px; background: #fff; margin: 0 auto 10px; border-radius: 10px; }
.dm-dialog p { color: var(--dm-muted); font-size: .83rem; margin: 0 0 10px; }
.dm-dialog [data-dm-close] { display: block; margin: -7px -7px 4px auto; border: 0; color: var(--dm-ink); background: var(--dm-soft); border-radius: 7px; width: 33px; height: 33px; font-size: 1.35rem; cursor: pointer; }

html:has(#dm-wide[open]) { overflow: hidden; }
.dm-wide {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--dm-ink);
  background: var(--dm-soft);
  overflow: auto;
}
.dm-wide-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px clamp(14px, 3vw, 40px);
  border-bottom: 1px solid var(--dm-line);
  background: var(--dm-paper);
}
.dm-wide-head h2 { flex: 1; color: var(--dm-ink); margin: 0; font-size: clamp(.95rem, 2.1vw, 1.45rem); }
.dm-wide-order { color: var(--dm-accent); font-size: .79rem; }
.dm-wide [data-dm-expand] { display: none; }
.dm-wide .dm-config { grid-template-columns: minmax(0, 1fr) clamp(320px, 39%, 540px); margin: 0 auto; padding: 16px clamp(14px, 3vw, 40px) 28px; }
.dm-wide :is(.dm-gallery, .dm-series, .dm-order) { scroll-margin-top: 76px; }
.dm-wide .dm-order { top: 69px; max-height: calc(100dvh - 84px); overflow-y: auto; scrollbar-width: thin; }

@media (max-width: 710px) {
  .dm-hero { min-height: 0; padding: 23px 20px; grid-template-columns: 1fr; gap: 15px; border-radius: 15px; }
  .dm-hero h1 { max-width: 17ch; }
  .dm-hero-art { height: 133px; width: min(300px, 90%); margin: 0 auto; }
  .dm-hero-art span { width: 45%; }
  .dm-hero-art span:nth-child(2) { left: 27%; }
  .dm-hero-art span:nth-child(3) { left: 54%; top: 16%; }
}
@media (max-width: 820px) {
  .dm-config { display: flex; flex-direction: column; }
  .dm-gallery, .dm-order { width: 100%; box-sizing: border-box; }
  .dm-order, .dm-wide .dm-order { position: static; max-height: none; overflow: visible; }
  .dm-mount-controls button { width: 44px; height: 40px; }
  .dm-tile:has(input:checked) .dm-to-mount { display: block; padding: 0 5px 9px; color: var(--dm-accent); text-align: center; font-size: .75rem; font-weight: 700; }
}
