:root {
  font-family: system-ui, sans-serif;
  color: #172554;
  background: #f4f6fb;
  line-height: 1.6;
  --icon-color: #172554;
}

* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 1120px; margin: auto; padding: 32px 24px; }
h1 { font-size: clamp(1.5rem, 4vw, 2rem); line-height: 1.2; margin: 0 0 16px; }
h2 { font-size: 1.1rem; margin: 0 0 16px; }
a { color: #334fc4; }
code { font-family: ui-monospace, monospace; font-size: 0.9em; overflow-wrap: anywhere; }
pre { overflow: auto; margin: 0; padding: 16px; background: #eef1f8; border-radius: 8px; line-height: 1.6; }
pre code { font-size: 0.8rem; }
.setup, #support { font-size: 0.85rem; }
#support { color: #8a5700; margin-bottom: 24px; }
#support.supported { color: #247555; }
.demo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; border: 1px solid #dce2ee; background: #dce2ee; }
.demo-grid > section { min-width: 0; padding: 24px; background: white; }
.picker { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 24px; }
.preview-stage { display: grid; place-items: center; background: #f4f6fb; border-radius: 8px; }
.linked-icon,
.linked-sheet {
  link-parameters: param(--icon-index, var(--icon-index)), param(--icon-color, var(--icon-color));
}
.linked-sheet {
  link-parameters: param(--icon-color, var(--icon-color));
}
/* var() defers validation, so the newer syntax needs an explicit guard. */
@supports (link-parameters: param(--icon-index: 0)) {
  .linked-icon {
    link-parameters: param(--icon-index: var(--icon-index)), param(--icon-color: var(--icon-color));
  }
  .linked-sheet {
    link-parameters: param(--icon-color: var(--icon-color));
  }
}
#selected-name { font-weight: 650; font-size: 0.9rem; }
label { display: block; margin-top: 14px; font-size: 0.9rem; }
label:first-child { margin-top: 0; }
select { width: 100%; padding: 8px; font: inherit; }
input[type="range"] { width: 100%; accent-color: #334fc4; }
input[type="color"] { width: 64px; height: 36px; }
.coordinates, .caption { color: #52617b; font-size: 0.8rem; }
.sheet { position: relative; aspect-ratio: 10 / 6; border: 1px solid #dce2ee; }
.sheet > img { display: block; width: 100%; height: 100%; }
#cells { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(10, 1fr); grid-template-rows: repeat(6, 1fr); }
.cell { border: 0; background: transparent; padding: 0; cursor: pointer; min-width: 0; }
.cell[aria-pressed="true"] { border: 3px solid #334fc4; background: #334fc414; }
.cell:hover { background: #334fc41c; }
.cell:focus-visible { outline: 3px solid #b43e00; outline-offset: -4px; z-index: 1; }
footer { color: #52617b; font-size: 0.85rem; }

@media (max-width: 720px) {
  main { padding: 24px 12px; }
  .demo-grid { grid-template-columns: 1fr; }
  .demo-grid > section { padding: 16px; }
  .picker { gap: 16px; }
}
