:root {
  --ink: #111111;
  --ink-soft: #222222;
  --paper: #f4f3ee;
  --panel: #fbfaf6;
  --panel-muted: #efeee9;
  --stage: #282827;
  --line: #d8d6cf;
  --line-dark: #3a3a38;
  --muted: #77766f;
  --acid: #c8ff3d;
  --red: #ff4d45;
  --header-height: 62px;
  --status-height: 28px;
  color-scheme: light;
  font-family: Inter, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-synthesis: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--stage);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button,
a,
input[type="color"] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid #5e8cff;
  outline-offset: 2px;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

.app {
  display: grid;
  grid-template-rows: var(--header-height) minmax(0, 1fr) var(--status-height);
  width: 100%;
  height: 100dvh;
  min-width: 320px;
}

.topbar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(214px, auto) minmax(140px, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 0 12px 0 17px;
  background: var(--ink);
  color: white;
  border-bottom: 1px solid #292929;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 14px;
  letter-spacing: .055em;
  white-space: nowrap;
}

.brand em {
  color: #8c8c87;
  font-family: Inter, "Helvetica Neue", sans-serif;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.brand-mark {
  position: relative;
  display: inline-block;
  width: 17px;
  height: 17px;
  border: 2px solid currentColor;
}

.brand-mark i {
  position: absolute;
  left: 2px;
  width: 9px;
  height: 2px;
  background: currentColor;
}

.brand-mark i:nth-child(1) { top: 2px; }
.brand-mark i:nth-child(2) { top: 6px; }
.brand-mark i:nth-child(3) { top: 10px; }

.document-title {
  min-width: 0;
}

.document-title input {
  width: min(100%, 360px);
  min-width: 0;
  padding: 8px 11px;
  color: #c7c7c2;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 12px;
  text-align: center;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.document-title input:hover {
  background: #1d1d1d;
  color: white;
}

.document-title input:focus {
  background: #202020;
  border-color: #424242;
  color: white;
}

.topbar-actions,
.history-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.history-actions {
  margin-right: 4px;
  padding-right: 10px;
  border-right: 1px solid #343434;
}

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .025em;
  white-space: nowrap;
  transition: background .14s ease, border-color .14s ease, color .14s ease, transform .14s ease;
}

.button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.button:active,
.icon-button:active {
  transform: translateY(0);
}

.button-ghost {
  color: #bdbdb8;
  border-color: #343434;
}

.button-ghost:hover {
  color: white;
  background: #242424;
  border-color: #4a4a4a;
}

.button-light {
  color: var(--ink);
  background: white;
  border-color: white;
}

.button-light:hover {
  background: var(--acid);
  border-color: var(--acid);
}

.button-dark {
  color: white;
  background: var(--ink);
  border-color: var(--ink);
}

.button-dark:hover {
  background: #303030;
}

.icon-button {
  width: 36px;
  padding: 0;
}

.icon-button:disabled {
  color: #5f5f5d;
  cursor: default;
  transform: none;
}

.topbar .icon-button {
  color: #bdbdb8;
}

.topbar .icon-button:hover:not(:disabled) {
  color: white;
  background: #292929;
}

.workspace {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 302px;
  min-width: 0;
  min-height: 0;
}

.toolrail {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 0;
  padding: 10px 7px;
  overflow: auto;
  background: #171717;
  color: #d6d6d1;
  border-right: 1px solid #2e2e2d;
  scrollbar-width: none;
}

.toolrail::-webkit-scrollbar { display: none; }

.tool-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 56px;
  min-height: 55px;
  padding: 6px 2px 5px;
  color: #92928e;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  transition: color .12s ease, background .12s ease, border-color .12s ease;
}

.tool-button svg {
  width: 20px;
  height: 20px;
}

.tool-button span {
  font-size: 9px;
  font-weight: 600;
}

.tool-button kbd {
  position: absolute;
  top: 4px;
  right: 5px;
  color: #62625f;
  font: 8px/1 monospace;
}

.tool-button:hover {
  color: white;
  background: #222;
}

.tool-button.is-active {
  color: var(--ink);
  background: var(--acid);
  border-color: var(--acid);
}

.tool-button.is-active kbd {
  color: #677c2e;
}

.rail-divider {
  width: 30px;
  height: 1px;
  margin: 4px 0;
  background: #333;
}

.rail-spacer {
  flex: 1 1 auto;
  min-height: 12px;
}

.stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background-color: var(--stage);
  background-image:
    linear-gradient(45deg, rgba(255,255,255,.018) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,.018) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,.018) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.018) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#editorCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  outline: none;
}

#editorCanvas[data-cursor="eraser"] { cursor: cell; }
#editorCanvas[data-cursor="picker"] { cursor: copy; }
#editorCanvas[data-cursor="select"] { cursor: crosshair; }
#editorCanvas[data-cursor="hand"] { cursor: grab; }
#editorCanvas[data-cursor="grabbing"] { cursor: grabbing; }
#editorCanvas[data-cursor="stamp"] { cursor: copy; }

.canvas-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  gap: 5px;
  color: #8d8d88;
  pointer-events: none;
  text-align: center;
  transform: translate(-50%, -50%);
}

.canvas-empty span { font-size: 13px; }
.canvas-empty small { font-size: 10px; }

.selection-bar,
.zoom-controls,
.stamp-hint,
.navigation-guide {
  position: absolute;
  z-index: 5;
  display: flex;
  align-items: center;
  background: #111;
  color: white;
  border: 1px solid #41413f;
  border-radius: 6px;
  box-shadow: 0 8px 30px rgba(0,0,0,.28);
}

.navigation-guide {
  top: 14px;
  left: 14px;
  gap: 7px;
  min-height: 32px;
  padding: 0 10px;
  color: #bdbdb8;
  cursor: pointer;
  font-size: 9px;
  opacity: 1;
  transition: color .16s ease, opacity .3s ease, background .16s ease;
}

.navigation-guide:hover,
.navigation-guide:focus-visible {
  color: white;
  background: #242423;
  opacity: 1;
}

.navigation-guide.is-quiet {
  opacity: .42;
}

.navigation-guide svg {
  width: 15px;
  height: 15px;
}

.touch-navigation-guide { display: none; }

.selection-bar {
  top: 14px;
  left: 50%;
  gap: 3px;
  padding: 4px;
  transform: translateX(-50%);
}

.selection-bar > span {
  padding: 0 10px 0 7px;
  color: #a7a7a2;
  font: 10px/1 monospace;
}

.selection-bar button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 9px;
  color: #e6e6e1;
  background: transparent;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  font-size: 10px;
}

.selection-bar button:hover { background: #2b2b2a; }
.selection-bar button svg { width: 14px; height: 14px; }
.selection-bar button.danger-action:hover { color: #ff8d88; }

.zoom-controls {
  right: 15px;
  bottom: 15px;
  gap: 1px;
  padding: 3px;
}

.zoom-controls .icon-button {
  width: 32px;
  height: 32px;
  color: #bdbdb8;
}

.zoom-controls .icon-button:hover { background: #2c2c2b; color: white; }

#zoomValue {
  width: 50px;
  height: 32px;
  padding: 0;
  color: #c9c9c4;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: 9px/1 monospace;
}

#zoomValue:hover { color: white; }

.stamp-hint {
  left: 15px;
  bottom: 15px;
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
  padding: 9px 12px;
  pointer-events: none;
}

.stamp-hint span { font-size: 10px; font-weight: 700; }
.stamp-hint small { color: #9d9d98; font-size: 9px; }

.sidepanel {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 17px 16px 12px;
  overflow: auto;
  background: var(--panel);
  border-left: 1px solid var(--line);
  scrollbar-color: #c4c2bb transparent;
  scrollbar-width: thin;
}

.sidepanel-head,
.section-title-row,
.ink-input-wrap,
.sidepanel-footer,
.stamp-controls,
.stamp-controls > div {
  display: flex;
  align-items: center;
}

.sidepanel-head,
.section-title-row,
.sidepanel-footer,
.stamp-controls {
  justify-content: space-between;
}

.sidepanel-head h1,
.section-title-row h2 {
  margin: 3px 0 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 17px;
  letter-spacing: -.015em;
}

.section-title-row h2 { font-size: 15px; }

.eyebrow,
.dialog-kicker {
  display: block;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.close-panel-button,
.mobile-panel-button {
  display: none;
}

.ink-control {
  margin: 17px 0 14px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.ink-control > label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

.ink-input-wrap {
  gap: 9px;
}

#inkColor {
  width: 31px;
  height: 31px;
  padding: 2px;
  overflow: hidden;
  background: white;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}

#inkColor::-webkit-color-swatch-wrapper { padding: 0; }
#inkColor::-webkit-color-swatch { border: 0; border-radius: 50%; }
#inkColor::-moz-color-swatch { border: 0; border-radius: 50%; }

#inkHex {
  color: #4f4e49;
  font: 10px/1 monospace;
  text-transform: uppercase;
}

.color-presets {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.color-preset {
  width: 18px;
  height: 18px;
  padding: 0;
  background: var(--swatch);
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #bbb9b2;
  cursor: pointer;
}

.color-preset.is-active { box-shadow: 0 0 0 2px var(--ink); }

.tile-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.tile-button {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  min-width: 0;
  padding: 3px;
  overflow: hidden;
  background: #f3f2ed;
  border: 1px solid #dfddd5;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease, transform .12s ease;
}

.tile-button:hover {
  z-index: 1;
  background: white;
  border-color: #9e9c94;
  transform: translateY(-1px);
}

.tile-button.is-active {
  background: white;
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.tile-button svg {
  display: block;
  width: 100%;
  height: 100%;
  stroke-width: 0;
}

.regions-section {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.count {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  color: white;
  background: var(--ink);
  border-radius: 20px;
  font: 9px/1 monospace;
}

.region-help {
  margin: 9px 0 12px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.regions-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.region-card {
  position: relative;
  min-width: 0;
}

.region-select {
  width: 100%;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  text-align: left;
  background: white;
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
  transition: border-color .12s ease, transform .12s ease;
}

.region-select:hover {
  border-color: #99978f;
  transform: translateY(-1px);
}

.region-card.is-active .region-select {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.region-preview {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1.65;
  background-color: #efeee9;
  background-image: linear-gradient(45deg, #e7e6e0 25%, transparent 25%), linear-gradient(-45deg, #e7e6e0 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e7e6e0 75%), linear-gradient(-45deg, transparent 75%, #e7e6e0 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  border-bottom: 1px solid var(--line);
}

.region-preview svg {
  display: block;
  width: calc(100% - 22px);
  height: calc(100% - 18px);
  overflow: visible;
}

.region-meta {
  display: block;
  min-width: 0;
  padding: 8px 9px 7px;
}

.region-meta strong,
.region-meta small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.region-meta strong {
  font-size: 10px;
  font-weight: 750;
}

.region-meta small {
  margin-top: 3px;
  color: var(--muted);
  font: 8px/1 monospace;
}

.delete-region {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  padding: 0;
  color: #aaa9a3;
  background: rgba(255,255,255,.92);
  border: 1px solid #d7d5ce;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s ease, color .12s ease;
}

.region-card:hover .delete-region,
.delete-region:focus-visible { opacity: 1; }
.delete-region:hover { color: var(--red); }
.delete-region svg { width: 13px; height: 13px; }

.stamp-controls {
  position: sticky;
  bottom: 27px;
  gap: 8px;
  margin: 14px -5px 0;
  padding: 8px 8px 8px 12px;
  background: var(--acid);
  border: 1px solid #a9df24;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(45,55,10,.16);
}

.stamp-controls > span {
  min-width: 0;
  overflow: hidden;
  font-size: 10px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stamp-controls > div { gap: 2px; }
.stamp-controls .icon-button { width: 29px; height: 29px; }
.stamp-controls .icon-button:hover { background: rgba(0,0,0,.1); }

.sidepanel-footer {
  gap: 10px;
  margin-top: auto;
  padding-top: 18px;
  color: #99978f;
  font-size: 8px;
}

.text-action {
  padding: 0;
  color: #4e4d48;
  background: none;
  border: 0;
  border-bottom: 1px solid #aaa8a1;
  cursor: pointer;
  font-size: 9px;
}

.text-action:hover { color: black; border-color: black; }

.statusbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 19px;
  padding: 0 12px 0 84px;
  color: #8c8c87;
  background: #171717;
  border-top: 1px solid #30302f;
  font: 9px/1 monospace;
}

.statusbar span + span::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 10px;
  margin-right: 19px;
  vertical-align: -2px;
  background: #363635;
}

.save-status {
  margin-left: auto;
}

.save-status i {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 5px;
  background: var(--acid);
  border-radius: 50%;
}

.save-status.is-saving i {
  background: #f2bd48;
  animation: blink .65s ease infinite alternate;
}

@keyframes blink { to { opacity: .25; } }

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 44px;
  max-width: calc(100% - 32px);
  padding: 10px 14px;
  color: white;
  background: #111;
  border: 1px solid #444;
  border-radius: 5px;
  box-shadow: 0 10px 40px rgba(0,0,0,.35);
  font-size: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .18s ease, transform .18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.panel-scrim { display: none; }

dialog {
  width: min(430px, calc(100% - 32px));
  padding: 0;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid #b9b7af;
  border-radius: 8px;
  box-shadow: 0 28px 90px rgba(0,0,0,.38);
}

dialog::backdrop {
  background: rgba(0,0,0,.58);
  backdrop-filter: blur(2px);
}

dialog form {
  padding: 26px;
}

dialog h2 {
  margin: 6px 0 8px;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 25px;
  letter-spacing: -.025em;
}

dialog p {
  margin: 0 0 21px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

dialog label {
  display: grid;
  gap: 7px;
  color: #55544f;
  font-size: 9px;
  font-weight: 700;
}

dialog input[type="text"],
dialog input[type="number"] {
  width: 100%;
  height: 39px;
  padding: 0 11px;
  color: var(--ink);
  background: white;
  border: 1px solid #cbc9c1;
  border-radius: 4px;
  font-size: 12px;
}

.dialog-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 13px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 24px;
}

.dialog-actions .button-ghost {
  color: #55544f;
  border-color: #cccac3;
}

.dialog-actions .button-ghost:hover {
  color: var(--ink);
  background: white;
  border-color: #99978f;
}

.export-options {
  display: grid;
  gap: 8px;
}

.export-option {
  position: relative;
  display: grid;
  grid-template-columns: 54px 1fr 24px;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 15px;
  text-align: left;
  background: white;
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
}

.export-option:hover { border-color: var(--ink); }
.export-option span { font-family: "Arial Black", Impact, sans-serif; font-size: 15px; }
.export-option small { color: var(--muted); font-size: 10px; }
.export-option svg { justify-self: end; }

.shortcuts-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0;
  border-top: 1px solid var(--line);
}

.shortcuts-grid span,
.shortcuts-grid kbd {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
}

.shortcuts-grid kbd {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

[data-tooltip] { position: relative; }

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 60;
  top: calc(100% + 7px);
  left: 50%;
  width: max-content;
  max-width: 190px;
  padding: 6px 8px;
  color: white;
  background: #111;
  border: 1px solid #444;
  border-radius: 4px;
  box-shadow: 0 5px 18px rgba(0,0,0,.28);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.3;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -3px);
  transition: opacity .12s ease, transform .12s ease;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toolrail [data-tooltip]::after {
  top: 50%;
  left: calc(100% + 8px);
  transform: translate(0, -50%);
}

.toolrail [data-tooltip]:hover::after,
.toolrail [data-tooltip]:focus-visible::after {
  transform: translate(3px, -50%);
}

@media (max-width: 1040px) {
  .workspace { grid-template-columns: 64px minmax(0, 1fr) 280px; }
  .tool-button { width: 50px; }
  .topbar { grid-template-columns: minmax(190px, auto) minmax(100px, 1fr) auto; gap: 8px; }
  .compact-hide { width: 36px; padding: 0; font-size: 0; }
  .compact-hide svg { width: 18px; height: 18px; }
}

@media (max-width: 780px) {
  .topbar {
    grid-template-columns: auto minmax(60px, 1fr) auto;
    padding-left: 11px;
  }

  .brand { font-size: 0; min-width: 30px; }
  .brand em { display: none; }
  .document-title input { text-align: left; }
  .history-actions,
  .compact-hide { display: none; }
  .button-light { width: 36px; padding: 0; font-size: 0; }
  .mobile-panel-button { display: inline-flex; }

  .workspace { grid-template-columns: 55px minmax(0, 1fr); }
  .toolrail { padding-inline: 4px; }
  .tool-button { width: 45px; min-height: 49px; }
  .tool-button span { display: none; }

  .sidepanel {
    position: fixed;
    z-index: 80;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(302px, 88vw);
    transform: translateX(102%);
    transition: transform .22s ease;
  }

  .sidepanel.is-open { transform: translateX(0); }
  .close-panel-button { display: inline-flex; }
  .panel-scrim {
    position: fixed;
    z-index: 75;
    inset: 0;
    display: block;
    background: rgba(0,0,0,.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
  }
  .panel-scrim.is-visible { opacity: 1; pointer-events: auto; }

  .statusbar { padding-left: 64px; gap: 12px; }
  .statusbar span + span::before { margin-right: 12px; }
  #gridStatus { display: none; }
  .selection-bar { top: 8px; }
  .selection-bar button { width: 31px; padding: 0; justify-content: center; font-size: 0; }
  .selection-bar > span { padding-inline: 5px; }
  .zoom-controls { right: 9px; bottom: 9px; }
  .navigation-guide { top: 8px; left: 8px; }
  .stamp-hint { left: 9px; bottom: 9px; }
}

@media (pointer: coarse) {
  .mouse-navigation-guide { display: none; }
  .touch-navigation-guide { display: inline; }
  .navigation-guide {
    min-height: 42px;
    padding-inline: 12px;
  }
  .tool-button {
    min-height: 56px;
  }
  .zoom-controls {
    gap: 2px;
    padding: 4px;
  }
  .zoom-controls .icon-button,
  #zoomValue {
    width: 42px;
    height: 42px;
  }
  .selection-bar button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    justify-content: center;
  }
  .topbar .button,
  .topbar .icon-button {
    min-width: 42px;
    height: 42px;
  }
  .color-preset {
    width: 26px;
    height: 26px;
  }
  .delete-region {
    width: 34px;
    height: 34px;
    opacity: 1;
  }
}

@media (hover: none) {
  [data-tooltip]::after { display: none; }
}

@media (max-width: 480px) {
  :root { --header-height: 56px; }
  .topbar { gap: 4px; }
  .document-title input { padding-inline: 5px; }
  .statusbar { padding-left: 61px; }
  .save-status { font-size: 0; }
  .save-status i { margin-right: 0; }
  .stamp-hint small { display: none; }
  dialog form { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
