.skip-link {
  position: fixed;
  left: 12px;
  top: -100px;
  z-index: 100;
  background: #4c1269;
  color: white;
  padding: 14px;
}
.skip-link:focus {
  top: 12px;
}
.site-utility {
  margin: 0 3vw;
  padding: 24px 0;
  border-top: 1px solid #4c126933;
  font-size: 13px;
}
.site-utility button,
.site-utility summary {
  min-height: 44px;
}
.site-utility button {
  padding: 10px 18px;
  margin: 0 8px 8px 0;
}
.site-utility summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.site-utility p {
  max-width: 680px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.back-top {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 10;
  background: #4c1269;
  color: #fff;
  padding: 12px;
  min-height: 44px;
  box-shadow: 0 2px 12px #0002;
}
footer {
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}
header {
  padding-top: max(24px, env(safe-area-inset-top));
}
.actions button,
.tabs button,
.workbar button,
.sound-toggle,
.music-actions button {
  min-height: 44px;
}
input[type="range"] {
  min-height: 30px;
}
.palette {
  min-height: 44px;
  min-width: 44px;
}
@media (max-width: 400px) {
  .panel-head {
    flex-wrap: wrap;
    gap: 12px;
  }
  .sound-tools {
    flex-wrap: wrap;
  }
  .site-utility {
    margin: 0 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
@media print {
  header,
  aside,
  .edit,
  .workbar,
  .site-utility,
  footer,
  .back-top {
    display: none !important;
  }
  main,
  .gallery {
    display: block !important;
    width: 100% !important;
  }
}

.text-tools {
  padding: 24px 0;
  border-top: 1px solid #4c126933;
}
.text-tools > label {
  display: block;
  font-size: 12px;
  margin: 18px 0 8px;
}
.text-tools textarea {
  box-sizing: border-box;
  width: 100%;
  resize: vertical;
  min-height: 90px;
  padding: 12px;
  font:
    16px/1.5 Nimbus,
    Helvetica,
    Arial,
    sans-serif;
  background: #fff9;
  border: 1px solid #4c126955;
  border-radius: 0;
  color: #4c1269;
}
.text-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.text-row label {
  font-size: 12px;
}
.text-row input[type="color"] {
  width: 44px;
  height: 44px;
  border: 0;
  padding: 3px;
  background: transparent;
}
.text-row button,
#shareImage,
#openImage {
  min-height: 44px;
  padding: 12px;
  font-size: 12px;
}
#openImage {
  display: inline-flex;
  align-items: center;
  color: #4c1269;
}
#exportStatus {
  line-height: 1.7;
}
#downloadDialog img {
  touch-action: auto;
  -webkit-touch-callout: default;
}

.intro span {
  display: inline-block;
  white-space: nowrap;
}
header > .export {
  white-space: nowrap;
  flex-shrink: 0;
}
.text-tools h2 b,
.sound h2 b {
  width: auto;
  min-width: 23px;
  padding: 0 6px;
  border-radius: 2px;
  flex-shrink: 0;
  font-size: 8px;
}
.sfx-choice {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 11px;
  margin: 8px 0;
}
.sfx-choice select {
  min-height: 44px;
  min-width: 0;
  padding: 8px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  font: inherit;
}
.panel-head {
  flex-wrap: wrap;
  gap: 12px;
}
@media (max-width: 760px) {
  header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand save" "intro intro";
    gap: 16px 20px;
    padding: 24px max(20px, env(safe-area-inset-right)) 20px
      max(20px, env(safe-area-inset-left));
    align-items: center;
  }
  .brand {
    grid-area: brand;
    justify-self: start;
  }
  .intro {
    grid-area: intro;
    display: block !important;
    margin: 0;
    font-size: 11px;
    line-height: 1.8;
  }
  .intro br {
    display: none;
  }
  .intro span:first-child {
    margin-right: 12px;
  }
  header > .export {
    grid-area: save;
    margin: 0;
    font-size: 12px;
    gap: 12px;
    padding: 14px 16px;
    min-height: 48px;
  }
  .brand span {
    font-size: 40px;
  }
  .brand {
    font-size: 19px;
  }
}

.brand {
  display: block;
  width: 200px;
  max-width: 100%;
  line-height: 0;
  letter-spacing: normal;
}
.brand img {
  display: block;
  width: 100%;
  height: auto;
}
.footer-wordmark {
  display: block;
  width: 120px;
  height: auto;
}
.guide-wordmark {
  display: block;
  width: 140px;
  height: auto;
  margin: 10px 0 18px;
}
@media (max-width: 760px) {
  .brand {
    width: 150px;
    max-width: 100%;
  }
}

/* Quiet footer disclosure: no banner or separate full-width panel. */
.footer-credit {
  max-width: 340px;
  min-width: 170px;
}
footer .analytics-choice {
  margin: 4px 0 0;
  padding: 0;
  border: 0;
  font-size: 11px;
  line-height: 1.7;
}
footer .analytics-choice summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  width: fit-content;
  text-decoration: underline;
  text-underline-offset: 3px;
}
footer .analytics-choice p {
  margin: 8px 0;
}
footer .analytics-choice button {
  min-height: 44px;
  padding: 8px 10px;
  margin: 0 6px 0 0;
  font-size: 11px;
  border: 1px solid var(--line);
}
footer .analytics-choice button[aria-pressed="true"] {
  text-decoration: underline;
  text-underline-offset: 3px;
}
footer .analytics-choice a {
  color: inherit;
}
