:root {
  --bg: #121212;
  --bg-elevated: #1e1e1e;
  --bg-elevated-soft: #181818;
  --accent: #ff4c8a;
  --accent-soft: #ff4c8a33;
  --border-soft: #333;
  --text-main: #f5f5f5;
  --text-muted: #aaaaaa;
  --danger: #ff5c5c;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: radial-gradient(circle at top left, #272727, #101010);
  color: var(--text-main);
  min-height: 100vh;
  margin: 0;
}

/* Main container */

.page-main {
  display: flex;
  justify-content: center;
}

.page-inner {
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Header */

.page-header {
  display: flex;
  justify-content: center;
}

.page-header-inner {
  width: 100%;
  max-width: 1200px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

/* Logo pulse animation */
@keyframes logo-pulse {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 0 rgba(255, 76, 138, 0.55);
  }
  50% {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 0 25px 0 rgba(255, 76, 138, 0.3);
  }
  100% {
    transform: translateY(0) scale(1);
    box-shadow: 0 0 0 0 rgba(255, 76, 138, 0.0);
  }
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: radial-gradient(circle at left, #ff9b6d, #ff4c8a);
  color: #fff;
  letter-spacing: 0.16em;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  animation: logo-pulse 4.5s ease-in-out infinite;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.brand-pill:hover {
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 0 30px rgba(255, 76, 138, 0.6);
}

.brand-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
}

/* Donate button */

.donate-link {
  font-size: 0.8rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, #242424, #171717);
  color: #f0f0f0;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55);
  transition: background 0.18s ease, transform 0.1s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.donate-link::before {
  content: "♡";
  font-size: 0.8rem;
  opacity: 0.85;
}

.donate-link:hover {
  background: linear-gradient(135deg, #2e2e2e, #202020);
  border-color: var(--accent);
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.7);
}

.donate-link:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

/* Controls */

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  align-items: stretch;
  background: var(--bg-elevated);
  padding: 0.9rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.45);
}

.control-block {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.control-label {
  font-weight: 500;
  color: var(--text-main);
  font-size: 0.85rem;
}

/* Image chooser */

.image-block {
  min-width: 0;
}

#fileInput {
  display: none;
}

/* subtle hover animation */
.file-drop {
  border-radius: 10px;
  border: 1px dashed var(--border-soft);
  background: #151515;
  padding: 0.6rem 0.7rem;
  cursor: pointer;
  display: block;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    transform 0.1s ease,
    box-shadow 0.18s ease;
}

.file-drop:hover {
  border-color: var(--accent);
  background: #181818;
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.6);
}

.file-drop-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.file-drop-title {
  font-size: 0.9rem;
  color: var(--text-main);
}

.file-drop-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.file-types {
  color: var(--accent);
}

.drop-hint-small {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.file-name-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Colour pickers */

.colour-block {
  background: #151515;
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  border: 1px solid #272727;
}

.colour-block-header {
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
}

.colour-row {
  display: flex;
  gap: 0.6rem;
  align-items: stretch;
}

.colour-subrow {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.mini-label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.rgb-group {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

/* Tolerance block */

.tolerance-block {
  min-width: 0;
}

.tolerance-label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.tolerance-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Button row for Add mapping / Download result */

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

#addMappingBtn,
#downloadBtn {
  flex: 1 1 140px;
}

/* Inputs / colours */

input[type="file"],
input[type="color"],
input[type="number"],
input[type="text"] {
  font-size: 0.85rem;
}

input[type="color"] {
  width: 3.2rem;
  min-height: 3.4rem;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--border-soft);
  background: #000;
  align-self: stretch;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

input[type="color"]:hover,
input[type="color"]:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(255, 76, 138, 0.6);
  transform: translateY(-1px);
  outline: none;
}

input[type="number"],
input[type="text"] {
  padding: 0.1rem 0.35rem;
  background: #111;
  border: 1px solid var(--border-soft);
  color: var(--text-main);
  border-radius: 4px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="number"]:focus-visible,
input[type="text"]:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(255, 76, 138, 0.4);
  outline: none;
}

input[type="number"] {
  width: 3.2rem;
}

input[type="text"] {
  width: 6.1rem;
}

input[type="range"] {
  width: 150px;
}

/* Buttons */

button {
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.08s ease,
    box-shadow 0.18s ease;
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Primary button – throbby hover */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #ff9b6d);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.6);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
}

/* Secondary button */

.btn-secondary {
  background: #232323;
  border-color: var(--border-soft);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: #2a2a2a;
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
}

.btn-secondary:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
}

/* Armed state for Add mapping */

@keyframes add-mapping-armed-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 76, 138, 0.0);
  }
  50% {
    transform: scale(1.015);
    box-shadow: 0 0 18px 0 rgba(255, 76, 138, 0.45);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 76, 138, 0.0);
  }
}

.btn-secondary.btn-armed {
  background: radial-gradient(circle at top left, #3a1836, #241024);
  border-color: var(--accent);
  color: #fff;
  animation: add-mapping-armed-pulse 1.1s ease-in-out infinite;
}

/* Ghost small */

.btn-ghost-small {
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 0.15rem 0.6rem;
}

.btn-ghost-small:hover {
  background: #242424;
  color: var(--text-main);
  transform: translateY(-1px);
}

/* Icon-style buttons */

.btn-icon {
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: #202020;
  color: var(--text-main);
  font-size: 0.75rem;
  padding: 0.35rem 0.6rem;
  gap: 0.25rem;
}

.btn-icon[disabled] {
  opacity: 0.4;
  cursor: default;
}

.btn-icon:not([disabled]):hover {
  background: #2a2a2a;
  border-color: var(--accent);
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
}

.btn-icon-label {
  font-size: 0.75rem;
}

/* Usage hints */

.usage-hints {
  margin-top: 0.75rem;
  background: #181818;
  border-radius: 10px;
  border: 1px solid #292929;
  padding: 0.6rem 0.9rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.usage-hints ul {
  margin: 0;
  padding-left: 1.1rem;
}

.usage-hints li + li {
  margin-top: 0.2rem;
}

/* Preview panes */

.preview {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  align-items: stretch;
  overflow-x: hidden;
}

.pane {
  flex: 0 0 50%;
  min-width: 320px;
  background: var(--bg-elevated);
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  padding: 0.8rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  position: relative;
}

.pane-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}

.pane-header h3 {
  margin: 0;
  font-size: 1rem;
}

/* Canvas wrappers */

.canvas-wrapper {
  position: relative;
  width: 100%;
  height: clamp(320px, 60vh, 600px);
  overflow: auto;
}

#originalCanvasWrapper,
#resultCanvasWrapper {
  scrollbar-width: none;
}

#originalCanvasWrapper::-webkit-scrollbar,
#resultCanvasWrapper::-webkit-scrollbar {
  display: none;
}

/* Placeholder */

.pane-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.pane-placeholder-inner {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
}

.pane-placeholder-arrow {
  font-size: 1.4rem;
  margin-bottom: 0.15rem;
  color: var(--accent);
}

.pane-placeholder-text span {
  display: block;
  font-size: 0.76rem;
  color: #c0c0c0;
  margin-top: 0.2rem;
}

/* Overlay controls */

.canvas-overlay {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 10;
  pointer-events: none;
}

.overlay-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.35rem 0.4rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  pointer-events: auto;
}

.overlay-zoom,
.overlay-pan {
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay-zoom {
  gap: 0.2rem;
}

.zoom-btn,
.nav-btn {
  border-radius: 6px;
  border: 1px solid #3b3b3b;
  background: #202020;
  color: var(--text-main);
  padding: 0;
  width: 24px;
  height: 24px;
  font-size: 0.8rem;
  align-items: center;
  justify-content: center;
  display: inline-flex;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.08s ease;
}

.zoom-btn:hover,
.nav-btn:hover {
  background: #2a2a2a;
  border-color: var(--accent);
  transform: translateY(-1px);
}

.zoom-label {
  min-width: 46px;
  text-align: center;
  font-size: 0.75rem;
  border-radius: 999px;
  padding: 0 0.3rem;
  background: #151515;
  border: 1px solid #333;
  color: var(--text-muted);
}

.overlay-pan {
  flex-direction: column;
  gap: 0.15rem;
}

.overlay-pan-middle {
  display: flex;
  gap: 0.15rem;
}

.nav-btn--center {
  font-size: 0.8rem;
}

/* Canvases & markers */

#inputCanvas,
#markerCanvas {
  border: 2px dashed transparent;
  display: block;
}

#inputCanvas {
  background: #303030;
  cursor: crosshair;
}

#markerCanvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: transparent;
}

#outputCanvas {
  background: #303030;
  border: 2px dashed transparent;
  cursor: crosshair;
  display: block;
}

.pane--original.pane--drag-over #inputCanvas {
  border-color: var(--accent);
  background: #252525;
}

/* Mapping panel */

.mapping-panel {
  margin-top: 0.5rem;
  background: var(--bg-elevated);
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  padding: 0.8rem 1rem 1rem;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6);
}

.mapping-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.mapping-heading {
  flex: 1;
}

.mapping-panel-header h2 {
  margin: 0 0 0.2rem;
  font-size: 1.1rem;
}

.mapping-panel-subtitle {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.mapping-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: flex-end;
}

.mapping-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 0.6rem;
}

@media (min-width: 1200px) {
  .mapping-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.mapping-empty {
  margin-top: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  display: none;
}

.mapping-empty.visible {
  display: block;
}

.pill {
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  font-size: 0.78rem;
}

/* Mapping item – slight hover animation */

.mapping-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  background: linear-gradient(135deg, #1b1b1b, #191919);
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
  border: 1px solid #2c2c2c;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
  transition: transform 0.1s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.mapping-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6);
  border-color: rgba(255, 255, 255, 0.08);
}

.mapping-item--disabled {
  opacity: 0.45;
}

.mapping-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.mapping-swatches {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 100px;
}

.swatch {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.mapping-arrow {
  font-size: 1rem;
  color: var(--text-muted);
}

/* NEW: nicer alignment for mapping text block */

.mapping-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
}

/* Hex + RGB + meta rows share minimal horizontal padding */
.mapping-hexes,
.mapping-rgbs,
.mapping-meta {
  padding: 0 0.05rem;
}

/* Hex row */
.mapping-hexes {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.78rem;
}

/* RGB row – tucked neatly under hex */
.mapping-rgbs {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Tolerance row – consistent padding & spacing */
.mapping-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.05rem;
}

.hex {
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: #202020;
  border: 1px solid #333;
}

.hex--from {
  color: #ffd1d1;
}

.hex--to {
  color: #d1ffdf;
}

.hex-separator {
  margin: 0 0.25rem;
  color: var(--text-muted);
}

.mapping-tol {
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: #202020;
  border: 1px solid #333;
}

/* Toggle switch */

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  user-select: none;
}

.toggle input {
  display: none;
}

.toggle-slider {
  width: 30px;
  height: 16px;
  border-radius: 999px;
  background: #333;
  position: relative;
  transition: background 0.15s ease;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #bbb;
  top: 2px;
  left: 2px;
  transition: transform 0.18s ease, background 0.18s ease;
}

.toggle input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(14px);
  background: #fff;
}

.toggle-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.mapping-delete {
  border-radius: 999px;
  border: 1px solid rgba(255, 92, 92, 0.5);
  background: #2a1010;
  color: var(--danger);
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  padding: 0;
  flex-shrink: 0;
}

.mapping-delete:hover {
  background: #3a1515;
}

/* SEO sections */

.seo-section {
  margin-top: 1rem;
  background: #181818;
  border-radius: 10px;
  border: 1px solid #292929;
  padding: 0.8rem 1rem;
  font-size: 0.86rem;
}

.seo-section h2 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.seo-section p,
.seo-section ul,
.seo-section ol {
  margin: 0.25rem 0;
}

.seo-section ul,
.seo-section ol {
  padding-left: 1.1rem;
}

/* Keyboard shortcut legend */

.shortcut-legend {
  margin-top: 1rem;
  background: #181818;
  border-radius: 10px;
  border: 1px solid #292929;
  padding: 0.8rem 1rem;
  font-size: 0.85rem;
}

.shortcut-legend h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.shortcut-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: flex-start;
}

.key-cluster {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.key-cluster-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.key-row {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  margin-top: 0.1rem;
}

.key-row--arrow {
  justify-content: center;
}

.key {
  min-width: 26px;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  border: 1px solid #3a3a3a;
  background: #202020;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-main);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.key--spacer {
  visibility: hidden;
}

.key-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.shortcut-note {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Footer */

.footer {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.footer a {
  color: var(--accent);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.footer-copy {
  font-size: 0.78rem;
  color: var(--text-muted);
  opacity: 0.9;
}

/* Responsive */

@media (max-width: 960px) {
  body {
    padding: 0.75rem;
  }

  .preview {
    flex-direction: column;
  }

  .pane {
    flex: 1 1 auto;
    min-width: 0;
  }

  .canvas-wrapper {
    height: clamp(260px, 50vh, 420px);
  }

  .mapping-panel {
    padding-inline: 0.75rem;
  }

  .mapping-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .shortcut-grid {
    flex-direction: column;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .brand-pill {
    font-size: 0.75rem;
    padding-inline: 0.7rem;
  }

  .brand-subtitle {
    font-size: 0.75rem;
  }

  .controls {
    padding: 0.6rem 0.7rem;
  }

  .pane-header h3 {
    font-size: 0.9rem;
  }

  .canvas-wrapper {
    height: 240px;
  }

  .mapping-panel-header {
    flex-direction: column;
  }

  .mapping-actions {
    justify-content: flex-start;
  }
}
