/* Download widget (download-widget.js): split button, menu, steps.
 * Colours come from variables so each site sets its own; the fallbacks are neutral.
 * Kept identical in 12hobbies-studio and this repository. */
.dl {
  --dl-accent: #c1653f;
  --dl-accent-text: #fff;
  --dl-panel: rgba(127, 127, 127, 0.1);
  --dl-menu-bg: #fff;
  --dl-menu-text: #222;
  --dl-line: rgba(127, 127, 127, 0.35);
  box-sizing: border-box;
  max-width: 44rem;
  margin: 1.25rem 0 2rem;
  padding: 1.25rem;
  border: 1px solid var(--dl-line);
  border-radius: 14px;
  background: var(--dl-panel);
  overflow-wrap: anywhere;
}
.dl *, .dl *::before, .dl *::after { box-sizing: border-box; }
.dl p { margin: 0.5rem 0; }
.dl .dl-version, .dl .dl-file, .dl .dl-detect { font-size: 0.92em; opacity: 0.85; }

.dl .dl-split { position: relative; display: flex; margin: 0.9rem 0 0.2rem; }
.dl .dl-btn, .dl .dl-caret {
  margin: 0;
  border: 0;
  background: var(--dl-accent);
  color: var(--dl-accent-text);
  font: inherit;
  cursor: pointer;
}
.dl .dl-btn {
  flex: 1 1 auto;
  min-width: 0;
  padding: 1rem 1.1rem;
  border-radius: 12px 0 0 12px;
  font-size: 1.15em;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}
.dl .dl-caret {
  flex: 0 0 3.2rem;
  border-left: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 0 12px 12px 0;
}
.dl .dl-arrow {
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  margin-top: -0.25rem;
  border-right: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
  transform: rotate(45deg);
}
.dl .dl-caret[aria-expanded="true"] .dl-arrow { margin-top: 0.25rem; transform: rotate(-135deg); }
.dl .dl-btn:hover, .dl .dl-caret:hover, .dl .dl-btn:focus-visible, .dl .dl-caret:focus-visible { filter: brightness(0.9); color: var(--dl-accent-text); }
.dl .dl-btn:focus-visible, .dl .dl-caret:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }
.dl .dl-item:focus { outline: 2px solid var(--dl-accent); outline-offset: -2px; }

.dl .dl-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  max-height: min(30rem, 70vh);
  overflow-y: auto;
  padding: 0.4rem 0;
  border: 1px solid var(--dl-line);
  border-radius: 12px;
  background: var(--dl-menu-bg);
  color: var(--dl-menu-text);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
.dl .dl-menu[hidden] { display: none; }
.dl .dl-gh { padding: 0.5rem 1rem 0.2rem; font-size: 0.8em; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.7; }
.dl .dl-item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.55rem 1rem 0.55rem 2.2rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  position: relative;
}
.dl .dl-item:hover, .dl .dl-item:focus-visible { background: var(--dl-panel); }
.dl .dl-item[aria-checked="true"]::before { content: "\2713"; position: absolute; left: 0.8rem; top: 0.55rem; font-weight: 700; color: var(--dl-accent); }
.dl .dl-item.is-soon { cursor: default; opacity: 0.55; }
.dl .dl-item .dl-t { display: block; font-weight: 700; }
.dl .dl-item .dl-d { display: block; font-size: 0.88em; opacity: 0.8; }

.dl .dl-steps { margin: 0.8rem 0 0.4rem; padding-left: 1.4rem; }
.dl .dl-steps li { margin: 0.45rem 0; }
.dl h4 { margin: 0.9rem 0 0.2rem; font-size: 1em; }
.dl ul { margin: 0.2rem 0 0.4rem; padding-left: 1.3rem; }
.dl .dl-advanced { margin-top: 1.1rem; border-top: 1px solid var(--dl-line); padding-top: 0.2rem; font-size: 0.92em; }
.dl .dl-advanced h4 { opacity: 0.85; }
.dl .dl-btn.is-soon, .dl .dl-btn:disabled {
  border-radius: 12px;
  background: var(--dl-line);
  color: var(--dl-soon-text, inherit);
  cursor: default;
  filter: none;
}
.dl.dl-is-soon .dl-msg { margin-top: 0.7rem; }
.dl[data-dl-compact="1"] { margin: 0.8rem 0 0; padding: 0.9rem; }
.dl[data-dl-compact="1"] .dl-btn { padding: 0.8rem 0.9rem; font-size: 1.02em; }
.dl[data-dl-compact="1"] .dl-split { margin-top: 0.5rem; }
@media (prefers-color-scheme: dark) {
  .dl { --dl-menu-bg: #2b2520; --dl-menu-text: #f2e8d8; --dl-soon-text: #d9ccb8; }
}
@media (max-width: 30rem) {
  .dl { padding: 1rem; }
  .dl .dl-btn { padding: 0.85rem 0.8rem; font-size: 1.05em; }
  .dl .dl-caret { flex-basis: 2.8rem; }
}
