/* The swatches use the same colours as the pages they preview. */
[data-shade="garden"] {
  --sage: #b5c9ae;
  --sage-light: #d6e2d0;
  --accent: #48694f;
  --muted: #405344;
  --canopy: #3a5743;
  --rule: #81937f;
}

[data-shade="sea-glass"] {
  --paper: #f7fbfa;
  --ink: #203835;
  --forest: #204442;
  --accent: #40655f;
  --muted: #394f4d;
  --canopy: #34544f;
  --sage: #a7c8c2;
  --sage-light: #c8e2dc;
  --sage-pale: #dfefe9;
  --line: #b9d1cb;
  --rule: #738e89;
  --night: #1c3836;
  --on-dark: #f5fbf9;
}

[data-shade="olive-leaf"] {
  --paper: #fbfaf4;
  --ink: #333820;
  --forest: #444a27;
  --accent: #5a6133;
  --muted: #474c32;
  --canopy: #4d5231;
  --sage: #c5c797;
  --sage-light: #e1e3bd;
  --sage-pale: #eef0dc;
  --line: #d6d6b7;
  --rule: #898f6d;
  --night: #353b23;
  --on-dark: #fbfbea;
}

[data-shade="deep-fern"] {
  --paper: #f7faf5;
  --ink: #1a2b1e;
  --forest: #213827;
  --accent: #335d42;
  --muted: #2b4031;
  --canopy: #274833;
  --sage: #9bb69c;
  --sage-light: #c1d4bd;
  --sage-pale: #d6e3d5;
  --line: #b1c3ae;
  --rule: #758b73;
  --night: #142d1e;
  --on-dark: #f3f8f0;
}

.shade-picker {position:relative}
.shade-picker summary {
  display:flex;align-items:center;gap:.55rem;min-height:36px;padding:0 .7rem;
  border:1px solid var(--rule);border-radius:4px;color:var(--on-dark);
  font:500 .85rem/1.2 var(--sans);list-style:none;white-space:nowrap;
}
.shade-picker summary::-webkit-details-marker {display:none}
.shade-picker summary:hover,.shade-picker[open] summary {background:var(--canopy)}
.shade-swatch {
  display:inline-block;flex:none;width:2.65rem;height:1.25rem;border-radius:3px;
  border:1px solid var(--rule);
  background:linear-gradient(100deg,var(--sage-light) 0 33%,var(--sage) 33% 66%,var(--accent) 66% 100%);
}
.shade-picker summary .shade-swatch {width:1.22rem;height:1.22rem;border-radius:50%;border-color:var(--sage-light)}
.shade-panel {
  position:absolute;z-index:56;top:calc(100% + 5px);left:0;width:13.5rem;
  max-width:calc(100vw - 1.2rem);margin:0;padding:.4rem;min-inline-size:0;
  max-height:calc(100dvh - var(--bar-height) - 10px);overflow:auto;overscroll-behavior:contain;
  background:var(--paper);color:var(--ink);border:1px solid var(--line);border-radius:6px;
  box-shadow:0 10px 28px #17221b2b;
}
.shade-panel label {
  display:flex;align-items:center;gap:.7rem;padding:.55rem;min-height:44px;
  border-radius:3px;cursor:pointer;font:500 .93rem/1.35 var(--sans);
}
.shade-panel label:hover,.shade-panel label:focus-within {background:var(--sage-pale)}
.shade-panel label:has(input:checked) {background:var(--sage-light);font-weight:700}
.shade-panel input {flex:none;width:1rem;height:1rem;margin:0 0 0 auto;accent-color:var(--forest)}
.shade-sr-only {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

@media (max-width:760px) {
  .shade-picker {position:static}
  .shade-picker summary {padding-inline:.55rem}
  .shade-current {display:none}
  .shade-panel {top:100%;left:auto;right:.6rem}
}
@media (max-width:445px) {
  .preview-controls .preview-caption {display:none}
}
@media (max-width:330px) {
  .shade-picker summary {gap:.35rem;padding-inline:.4rem}
}
