    :root {
      --dark-royal-red: #8b0000;
      --petrol: #005f5f;
      --background: #111;
      --accent: #ffffff;
      --border: #ff4444;
      --bleed-border: rgba(255, 68, 68, 0.75);
      --bleed-width: 2.5px;
    }

    input[type="file"] {
      max-width: 100%;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
      display: inline-block;
    }

    body {
      font-family: 'Courier New', monospace;
      margin: 0;
      background: var(--background);
      color: var(--accent);
      display: flex;
      flex-direction: row;
      flex-wrap: wrap;
      background-image: url('../img/concrete-wall.png');
    }

    #sidebar {
      width: 100%;
      max-width: 300px;
      flex: 0 0 300px;
      background: var(--dark-royal-red);
      border-right: 4px solid var(--border);
      padding: 20px 24px;
      padding-top: 2rem;
      overflow-y: auto;
      box-sizing: border-box;
      background-image: url('../img/concrete-wall.png');
      position: sticky;
      top: 0;
      height: 100vh;

    }

    #controlSidebar {
      width: 100%;
      max-width: 300px;
      flex: 0 0 300px;
      background: var(--dark-royal-red);
      border-left: 4px solid var(--border);
      padding: 20px 24px;
      padding-top: 2rem;
      overflow-y: auto;
      overflow-x: visible;
      box-sizing: border-box;
      background-image: url('../img/concrete-wall.png');
      position: sticky;
      top: 0;
      height: 100vh;
      z-index: 10;
    }

    .panel-title {
      margin: 0 0 0.6em;
      font-weight: bold;
      color: var(--accent);
      letter-spacing: 0.08em;
      text-transform: uppercase;
      padding-right: 2.5rem;
    }

    #sidebar h3 {
      margin-top: 0;
      font-weight: bold;
      color: var(--accent);
      border-bottom: 2px solid var(--accent);
      padding-bottom: 0.3em;
    }

    #imageGallery img {
      width: 100%;
      margin-bottom: 5px;
      cursor: pointer;
      border: 2px solid var(--accent);
      background: var(--petrol);
    }

    .gallery-item {
      position: relative;
      display: inline-block;
      width: 100%;
      margin-bottom: 0.6em;
    }

    .gallery-item img {
      width: 100%;
      display: block;
    }

    .gallery-delete {
      position: absolute;
      top: 2px;
      right: -4px;
      color: red;
      border-radius: 50%;
      font-weight: bold;
      cursor: pointer;
      padding: 0 5px;
      z-index: 10;
    }

    details.gallery-toggle {
      border: 2px dashed var(--accent);
      padding: 0.5em;
      margin-top: 0.75em;
    }

    details.gallery-toggle summary {
      font-weight: bold;
      cursor: pointer;
    }

    #main {
      display: flex;
      flex-direction: column;
      align-items: center;
      flex: 1;
      min-width: 0;
      width: 100%;
      box-sizing: border-box;
      background-color: var(--petrol);
      border-left: 4px solid var(--border);
      background-image: url('../img/concrete-wall.png');
      overflow: visible;
    }

    #footer {
      margin-top: 6rem;
    }

    #main h1 {
      font-size: clamp(2rem, 4vw, 3.5rem);
      text-transform: uppercase;
      letter-spacing: 0.2rem;
      margin-block: 1rem 0.5rem;
      background: linear-gradient(135deg, #a40000 0%, #820000 40%, #5c0000 100%);
      color: var(--accent);
      padding: 0.6em 1.8em;
      border: 4px solid var(--border);
      box-shadow:
        inset 0 2px 6px rgba(255, 255, 255, 0.35),
        inset 0 -6px 8px rgba(0, 0, 0, 0.55),
        10px 12px 0 rgba(0, 0, 0, 0.65);
      text-shadow:
        0 1px 1px rgba(0, 0, 0, 0.8),
        0 -1px 1px rgba(255, 255, 255, 0.45),
        0 3px 0 rgba(0, 0, 0, 0.6),
        0 4px 6px rgba(0, 0, 0, 0.35),
        0 -2px 4px rgba(255, 255, 255, 0.25);
      position: relative;
      isolation: isolate;
      text-align: center;
    }

    #main h1::before,
    #main h1::after {
      content: "";
      position: absolute;
      inset: 8px;
      border-radius: 4px;
      pointer-events: none;
      z-index: -1;
    }

    #main h1::before {
      border: 2px solid rgba(255, 255, 255, 0.35);
      mix-blend-mode: screen;
      opacity: 0.7;
    }

    #main h1::after {
      border: 2px solid rgba(0, 0, 0, 0.6);
      top: 12px;
      left: 12px;
      right: 4px;
      bottom: 4px;
      opacity: 0.5;
    }

    #controls {
      padding: 0;
      display: flex;
      flex-direction: column;
      gap: 1em;
      margin: 0;
      padding-top: 0.6em;
      box-sizing: border-box;
      position: relative;
    }

    .action-bar {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 0.75em;
    }

    .action-bar #count {
      justify-content: center;
    }

    .action-bar #exportBtn {
      width: 100%;
    }

    #controlSidebar .help-tooltip {
      position: absolute;
      top: -0.85rem;
      right: 0.35rem;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 32px;
      height: 32px;
      border-radius: 50%;
      border: 2px solid var(--accent);
      background: rgba(255, 0, 0, 0);
      color: var(--accent);
      margin: 0;
      cursor: help;
      z-index: 50;
    }

    #controls input,
    #controls button,
    #controls label,
    #sidebar input,
    #sidebar button,
    #sidebar label {
      font-family: monospace;
      background: var(--petrol);
      color: var(--accent);
      border: 2px solid var(--accent);
      width: 100%;
      box-sizing: border-box;

      font-size: 1em;
    }

    #controls label,
    #sidebar label {
      display: flex;
      align-items: center;
      gap: 0.4em;
    }

    #controls label.stacked-label {
      flex-direction: column;
      align-items: flex-start;
      gap: 0.25em;
    }

    #controls label.stacked-label .stacked-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 100%;
      gap: 0.5em;
    }

    #controls label.stacked-label .stacked-row input {
      width: auto;
    }

    .color-picker {
      display: flex;
      flex-direction: column;
      gap: 0.5em;
    }

    .color-picker__sv {
      position: relative;
      width: 100%;
      aspect-ratio: 4 / 3;
      border: 2px solid var(--accent);
      cursor: crosshair;
      background:
        linear-gradient(to right, #ffffff, hsl(var(--hue, 0) 100% 50%)),
        linear-gradient(to top, #000000, rgba(0, 0, 0, 0));
      background-blend-mode: multiply;
    }

    .color-picker__sv-cursor {
      position: absolute;
      width: 12px;
      height: 12px;
      border: 2px solid #ffffff;
      border-radius: 50%;
      box-shadow: 0 0 0 1px #000000;
      transform: translate(-50%, -50%);
      pointer-events: none;
    }

    .color-picker__hue {
      width: 100%;
      height: 16px;
      border: 2px solid var(--accent);
      background: linear-gradient(
        to right,
        #ff0000 0%,
        #ffff00 17%,
        #00ff00 33%,
        #00ffff 50%,
        #0000ff 67%,
        #ff00ff 83%,
        #ff0000 100%
      );
      appearance: none;
      -moz-appearance: none;
      padding: 0;
    }

    .color-picker__row {
      display: flex;
      gap: 0.5em;
      align-items: center;
    }

    .color-picker__row input,
    .color-picker__row button {
      width: auto;
    }

    .color-picker__swatch {
      width: 28px;
      height: 28px;
      border: 2px solid var(--accent);
      box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.35);
      background: #ffffff;
      flex: 0 0 auto;
    }

    .color-picker__hex {
      width: 96px;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }

    #controls .color-picker__hex {
      width: 96px;
    }

    .color-picker__apply {
      flex: 1;
    }

    .color-picker__pick {
      width: 100%;
    }

    .color-picker__hue::-webkit-slider-runnable-track {
      height: 12px;
      background: linear-gradient(
        to right,
        #ff0000 0%,
        #ffff00 17%,
        #00ff00 33%,
        #00ffff 50%,
        #0000ff 67%,
        #ff00ff 83%,
        #ff0000 100%
      );
    }

    .color-picker__hue::-webkit-slider-thumb {
      appearance: none;
      width: 16px;
      height: 16px;
      background: var(--accent);
      border: 2px solid var(--dark-royal-red);
      margin-top: -2px;
      cursor: pointer;
    }

    .color-picker__hue::-moz-range-track {
      height: 12px;
      background: linear-gradient(
        to right,
        #ff0000 0%,
        #ffff00 17%,
        #00ff00 33%,
        #00ffff 50%,
        #0000ff 67%,
        #ff00ff 83%,
        #ff0000 100%
      );
    }

    .color-picker__hue::-moz-range-thumb {
      width: 16px;
      height: 16px;
      background: var(--accent);
      border: 2px solid var(--dark-royal-red);
      cursor: pointer;
    }

    body.color-pick-active #imageGallery img,
    body.color-pick-active #standardGallery img {
      cursor: crosshair;
      outline: 2px dashed var(--accent);
      outline-offset: 2px;
    }

    #colorPickPreview {
      position: fixed;
      z-index: 9999;
      display: none;
      pointer-events: none;
      background: rgba(0, 0, 0, 0.75);
      color: #ffffff;
      border: 2px solid var(--accent);
      padding: 4px 6px;
      font-family: monospace;
      font-size: 12px;
      align-items: center;
      gap: 6px;
      box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.6);
    }

    #colorPickPreview .preview-swatch {
      width: 16px;
      height: 16px;
      border: 1px solid #ffffff;
      box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4);
      background: #ffffff;
    }

    #controls label input,
    #sidebar label input,
    #controls label select,
    #sidebar label select {
      flex: 1;
    }

    #controls button:hover,
    #selectionControls button:hover {
      background: var(--accent);
      color: var(--dark-royal-red);
      cursor: pointer;
    }

    #canvasArea {
      width: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.5rem;
      position: relative;
    }

    #canvasWrapper {
      width: 100%;
      display: flex;
      justify-content: center;
      overflow: auto;
      max-width: 100%;
      box-sizing: border-box;
    }

    #canvasScale {
      flex: 0 0 auto;
      position: relative;
      display: block;
      margin: 0 auto;
      overflow: visible;
      will-change: width, height;
    }

    #a4canvas {
      background: var(--accent);
      width: 210mm;
      height: 297mm;
      position: relative;
      top: 0;
      left: 0;
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      grid-template-rows: auto repeat(6, 1fr);
      gap: 2mm;
      padding: 6mm;
      box-sizing: border-box;
      overflow: hidden;
      flex: 0 0 auto;
      transform-origin: top left;
      transition: transform 0.2s ease;
      will-change: transform;
    }

    #canvasZoomControls {
      width: 100%;
      color: var(--accent);
    }

    .slider-group {
      display: flex;
      flex-direction: column;
      gap: 0.3em;
      width: 100%;
    }

    .slider-group label {
      width: 100%;
      font-weight: bold;
      background: transparent;
      border: none;
      padding: 0;
      display: block;
    }

    .slider-row {
      display: flex;
      align-items: center;
      gap: 0.5em;
      width: 100%;
      background: var(--petrol);
      border: 2px solid var(--accent);
      padding: 0.35em 0.45em;
      box-sizing: border-box;
    }

    .slider-row input[type="range"] {
      flex: 1;
      background: transparent;
      border: none;
    }

    .slider-row span {
      min-width: 3.5em;
      text-align: right;
      font-weight: bold;
    }

    .button-slot {
      position: relative;
      width: 28mm;
      height: 28mm;
      justify-self: center;
      align-self: center;
      overflow: visible;
      cursor: pointer;
      transform-origin: center center;
      /* scale from the center */
      border-radius: 50%;
      z-index: 1;
    }

    .button-slot.selected {
      box-shadow: 0 0 0 3px var(--border);
      border-radius: 50%;
    }

    .button-content {
      position: absolute;
      inset: 0;
      border-radius: 50%;
      overflow: hidden;
      z-index: 10;
      background: transparent;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .overlay-inner,
    .overlay-middle,
    .overlay-outer,
    .overlay-cutline {
      position: absolute;
      top: 50%;
      left: 50%;
      border-radius: 50%;
      transform: translate(-50%, -50%);
      pointer-events: none;
    }

    .overlay-inner {
      width: 23mm;
      height: 23mm;
      border: 1px dashed lime;
      z-index: 30;
    }

    .overlay-middle {
      width: 25mm;
      height: 25mm;
      border: 1px dashed orange;
      z-index: 20;
    }

    .overlay-outer {
      width: 28mm;
      height: 28mm;
      border: var(--bleed-width) dashed var(--bleed-border);
      border-radius: 50%;
      background: transparent;
      box-shadow: none;
      z-index: 5;
      pointer-events: none;
    }

    .overlay-cutline-default,
    .overlay-cutline-custom {
      position: absolute;
      top: 50%;
      left: 50%;
      border-radius: 50%;
      transform: translate(-50%, -50%);
      pointer-events: none;
      border: 1px solid #00ffff;
      z-index: 40;
      display: none;
    }

    .overlay-cutline-default {
      width: 28mm;
      height: 28mm;
    }

    #page-gridlines {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 0;
      pointer-events: none;
      display: none;
    }

    #page-gridlines .gridline {
      position: absolute;
      background: #000;
      opacity: 0.45;
    }

    #page-gridlines .gridline.vertical {
      top: 0;
      bottom: 0;
      width: 1px;
    }

    #page-gridlines .gridline.horizontal {
      left: 0;
      right: 0;
      height: 1px;
    }

    .overlay-cutbox {
      position: absolute;
      inset: 0;
      border: 1px solid #000;
      box-sizing: border-box;
      z-index: 12;
      pointer-events: none;
      display: none;
    }

    .button-content img.button-image {
      position: absolute;
      top: 50%;
      left: 50%;
      width: auto;
      height: auto;
      display: block;
      z-index: 1;
      transform-origin: center center;
    }

    .button-bg-color {
      position: absolute;
      border-radius: 50%;
      z-index: 5;
      pointer-events: none;
    }


    .checkbox {
      position: absolute;
      top: -2.5px;
      left: -3.5px;
      z-index: 20;
      accent-color: var(--dark-royal-red);
    }

    #scaleContainer {
      position: fixed;
      bottom: 1rem;
      right: 1rem;
      background: var(--dark-royal-red);
      border: 2px solid var(--accent);
      padding: 0.5em;
      z-index: 100;
      color: var(--accent);
      font-family: monospace;
    }

    #scaleSlider {
      width: 150px;
      vertical-align: middle;
    }

    .tooltip {
      position: relative;
      display: inline-block;
      cursor: help;
      font-weight: bold;
    }

    .tooltip .tooltiptext {
      visibility: hidden;
      width: 90vw;
      max-width: 300px;
      background-color: var(--dark-royal-red);
      color: var(--accent);
      text-align: left;
      border: 2px solid var(--accent);
      padding: 10px;
      position: absolute;
      z-index: 30;
      top: 20px;
      left: 20px;
      opacity: 0;
      transition: opacity 0.3s;
    }

    #selectionControls {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5em;
      justify-content: center;
      margin: 1em 0;
      position: sticky;
      top: 0;
      z-index: 5;
      padding: 0.75em 0;
    }

    #selectionControls button {
      min-width: 200px;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      font-weight: bold;
      border: 3px solid var(--accent);
      background: var(--petrol);
      color: var(--accent);
      box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.7);
      transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
    }

    #selectionControls button:hover {
      background: var(--accent);
      color: var(--dark-royal-red);
      box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.85);
    }

    #selectionControls button:active {
      transform: translate(2px, 2px);
      box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.85);
    }

    .tooltip .tooltiptext {
      visibility: hidden;
      position: absolute;
      top: 2em;
      left: 50%;
      transform: translateX(-50%);
      z-index: 30;
      max-width: 300px;
      width: max-content;
      background-color: var(--dark-royal-red);
      color: var(--accent);
      text-align: left;
      border: 2px solid var(--accent);
      padding: 10px;
      opacity: 0;
      transition: opacity 0.3s ease;
      white-space: normal;
      overflow-wrap: break-word;
      box-sizing: border-box;
      pointer-events: none;
    }

    .tooltip:hover .tooltiptext {
      visibility: visible;
      opacity: 1;
    }

    #controlSidebar .help-tooltip .tooltiptext {
      left: auto;
      right: 0;
      transform: none;
      width: 280px;
      max-width: 85vw;
      margin-top: 0.4em;
      top: 100%;
      border-left-width: 2px;
      padding-left: 12px;
      z-index: 100;
    }

    .help-modal {
      position: fixed;
      inset: 0;
      display: none;
      z-index: 1000;
    }

    .help-modal.is-open {
      display: block;
    }

    .help-modal__backdrop {
      position: absolute;
      inset: 0;
      background: rgba(0, 0, 0, 0.6);
    }

    .help-modal__panel {
      position: absolute;
      top: 8vh;
      right: 6vw;
      width: min(540px, 92vw);
      max-height: 84vh;
      overflow: auto;
      background: var(--dark-royal-red);
      border: 3px solid var(--accent);
      padding: 1rem 1.25rem 1.25rem;
      box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.7);
      color: var(--accent);
      font-family: monospace;
    }

    .help-modal__close {
      position: absolute;
      top: 0.5rem;
      right: 0.5rem;
      border: 2px solid var(--accent);
      background: var(--petrol);
      color: var(--accent);
      padding: 0.2rem 0.4rem;
      cursor: pointer;
    }

    .help-modal__content h3 {
      margin: 0 0 0.5rem;
      text-transform: uppercase;
      letter-spacing: 0.08em;
    }

    .help-modal__content ul {
      margin: 0 0 1rem;
      padding-left: 1.1rem;
    }

    .logo-on-canvas {
      grid-column: 1 / -1;
      width: 35mm;
      height: auto;
      justify-self: center;
      align-self: start;
      padding-top: 50px;
    }

    #controls button {
      height: auto;
      align-self: flex;
    }
    .small-reset {
      margin-top: 0.5em;
      width: 100%;
    }

    #count {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      font-weight: bold;
      margin: 0;
    }

    /* Brutalist base style */
    .brutal-button {
      position: relative;
      overflow: hidden;
      color: #000;
      font-weight: bold;
      border: 4px solid #000;
      box-shadow: 4px 4px 0 #000;
      padding: 0.6em 1.2em;
      font-family: 'Courier New', monospace;
      font-size: 1rem;
      text-transform: uppercase;
      transition: transform 0.1s ease, box-shadow 0.1s ease;
      cursor: pointer;
      z-index: 1;
    }
    .brutal-button2 {
      position: relative;
      overflow: hidden;
      background: rgb(0, 157, 255) !important;
      color: #000;
      font-weight: bold;
      border: 4px solid #000;
      box-shadow: 4px 4px 0 #000;
      padding: 0.6em 1.2em;
      font-family: 'Courier New', monospace;
      font-size: 1rem;
      text-transform: uppercase;
      transition: transform 0.1s ease, box-shadow 0.1s ease;
      cursor: pointer;
      z-index: 1;
    }
    .brutal-button:hover {
      background: #ff4444;
      color: #fff;
    }

    .brutal-button:active {
      transform: translate(2px, 2px);
      box-shadow: 2px 2px 0 #000;
    }

    /* Shine effect */
    .brutal-button.shiny::before {
      content: "";
      position: absolute;
      top: 0;
      left: -75%;
      width: 50%;
      height: 100%;
      background: linear-gradient(120deg,
          transparent,
          rgba(255, 255, 255, 0.4),
          transparent);
      transform: skewX(-25deg);
      animation: shine 3s ease-in-out infinite;
      z-index: 2;
      pointer-events: none;
    }
    .brutal-button2.shiny::before {
      content: "";
      position: absolute;
      top: 0;
      left: -75%;
      width: 50%;
      height: 100%;
      background: linear-gradient(120deg,
          transparent,
          rgba(255, 255, 255, 0.4),
          transparent);
      transform: skewX(-25deg);
      animation: shine 3s ease-in-out infinite;
      z-index: 2;
      pointer-events: none;
    }
    @keyframes shine {
      0% {
        left: -75%;
      }

      100% {
        left: 125%;
      }
    }

    @media (max-width: 1024px) {
      #sidebar,
      #controlSidebar {
        max-width: 240px;
        flex: 0 0 240px;
        padding: 16px;
      }

      #controls,
      #sidebar {
        font-size: 0.92em;
      }

      #main h1 {
        font-size: clamp(1.6rem, 4.2vw, 2.6rem);
        padding: 0.5em 1.2em;
      }

      #selectionControls button {
        min-width: 160px;
        font-size: 0.85em;
      }

    }

    @media (max-width: 820px) {
      body {
        flex-direction: column;
      }

      #sidebar,
      #controlSidebar {
        position: static;
        max-width: 100%;
        flex: 1 1 auto;
        height: auto;
        border-left: none;
        border-right: none;
      }

      #main {
        border-left: none;
      }

      #selectionControls {
        position: static;
      }

    }
/* Mobile-focused overrides for index.html. Keeps original look via styles.css. */

body {
  overflow-x: hidden;
}

/* Panels (no internal collapse) */


.panel {
  border: none;
  margin-bottom: 0.75em;
  position: relative;
}

/* hide details marker if any details remain */
.panel > summary::-webkit-details-marker {
  display: none;
}

/* preserve styles for opened details (not used for panels) */
.panel[open] > summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* Floating zoom bar */
#floatingZoom {
  position: fixed;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  width: min(560px, 92vw);
  background: var(--dark-royal-red);
  border: 3px solid var(--accent);
  padding: 0.35em 0.6em;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.7);
  transition: bottom 0.2s ease;
  opacity: 0.8;
}

#floatingZoom .control {
  margin-bottom: 0;
}

#canvasWrapper {
  padding-bottom: 0;
}

/* Mobile overlapping panels */
@media (max-width: 900px) {
  #mobilePanelButtons {
    position: sticky;
    top: 0;
    z-index: 250;
    display: flex;
    gap: 0.5rem;
    padding: 0.6rem;
    background: var(--petrol);
    border-bottom: 3px solid var(--border);
  }

  #mobilePanelButtons button {
    flex: 1;
    font-family: monospace;
    text-transform: uppercase;
    border: 2px solid var(--accent);
    background: var(--dark-royal-red);
    color: var(--accent);
    padding: 0.45rem 0.6rem;
  }

  #panelScrim {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 240;
  }

  #panelScrim.active {
    opacity: 1;
    pointer-events: auto;
  }

  #sidebar,
  #controlSidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    height: auto;
    max-width: 85vw;
    width: 85vw;
    overflow-y: auto;
    z-index: 260;
    box-shadow: 10px 0 0 rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease;
  }

  #sidebar {
    left: 0;
    transform: translateX(-105%);
  }

  #controlSidebar {
    right: 0;
    transform: translateX(105%);
    box-shadow: -10px 0 0 rgba(0, 0, 0, 0.5);
  }

  #sidebar.panel-open {
    transform: translateX(0);
  }

  #controlSidebar.panel-open {
    transform: translateX(0);
  }

  #controls {
    margin: 0;
  }

  #selectionControls button {
    min-width: 160px;
  }
}

@media (max-width: 720px) {
  #selectionControls {
    gap: 0.35em;
  }

  #selectionControls button {
    min-width: 0;
    flex: 1 1 46%;
  }
}

@media (min-width: 901px) {
  #mobilePanelButtons {
    display: none;
  }

  #panelScrim {
    display: none;
  }
}
    /* =========================
       Export Log UI
       ========================= */
    #exportLogToggle {
      margin-top: 0.5em;
      width: 100%;
    }

    #exportLogPanel {
      position: fixed;
      right: 1rem;
      bottom: 1rem;
      width: min(480px, 90vw);
      max-height: 60vh;
      background: #111;
      color: #fff;
      border: 2px solid #fff;
      box-shadow: 6px 6px 0 #000;
      display: none;
      flex-direction: column;
      z-index: 9999;
    }

    #exportLogPanel.open {
      display: flex;
    }

    .export-log__header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.5rem;
      padding: 0.5rem;
      background: #222;
      border-bottom: 2px solid #fff;
      font-weight: bold;
    }

    .export-log__header button {
      border: 2px solid #fff;
      background: #000;
      color: #fff;
      padding: 0.2rem 0.4rem;
      cursor: pointer;
    }

    #exportLogText {
      width: 100%;
      height: 100%;
      min-height: 220px;
      background: #000;
      color: #0f0;
      border: none;
      padding: 0.5rem;
      box-sizing: border-box;
      font-family: "Courier New", monospace;
      resize: vertical;
    }
