    :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('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;
      padding-top: 2rem;
      overflow-y: auto;
      box-sizing: border-box;
      background-image: url('concrete-wall.png');
      position: sticky;
      top: 0;
      height: 100vh;
      padding-top: 2rem;
    }

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

    #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('concrete-wall.png');
    }

    #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;
    }

    #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: -14px;
      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 {
      display: block;
      text-align: right;
      margin-bottom: 0.5em;
      cursor: help;
      position: relative;
      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 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;
    }

    #a4canvas {
      background: var(--accent);
      width: 210mm;
      height: 297mm;
      position: relative;
      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 center;
      transition: transform 0.2s ease;
    }

    #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: 0;
      right: auto;
      transform: none;
      width: 100%;
      max-width: none;
      margin-top: 0.5em;
      top: 100%;
      border-left-width: 2px;
      padding-left: 12px;
      z-index: 100;
    }

    .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;
      background: #fff;
      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;
    }

    @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;
      }

    }
