:root {
  color-scheme: dark;
  --void: #000;
  --paper: #e8e8e5;
  --acid: #eeed50;
  --fill: 10%;
  --brush-x: 0px;
  --brush-y: 0px;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  background: var(--void);
  color: var(--paper);
}
* { box-sizing: border-box; }
html, body, main { margin: 0; width: 100%; height: 100%; overflow: hidden; }
main { position: relative; height: 100dvh; background: var(--void); }
#portrait { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; outline-offset: -4px; }
#portrait.dragging { cursor: grabbing; }
#brush-cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  #portrait.brushing:not(.dragging) { cursor: none; }
  #brush-cursor {
    display: block; position: absolute; inset: 0 auto auto 0; width: 33px; height: 33px; pointer-events: none;
    border: 1px solid #ffffffb5; border-radius: 50%; box-shadow: 0 0 0 1px #12121242;
    transform: translate3d(var(--brush-x), var(--brush-y), 0);
    opacity: 0; transition: opacity .12s;
  }
  #brush-cursor::after { content: ""; position: absolute; inset: 14px; background: #ffffffe0; border-radius: 50%; }
  #portrait.brushing:not(.dragging) + #brush-cursor { opacity: 1; }
}
header {
  position: absolute; top: max(30px, env(safe-area-inset-top)); left: 36px; right: 36px;
  display: flex; justify-content: space-between; align-items: center; pointer-events: none;
}
h1 { margin: 0; display: flex; align-items: center; gap: 11px; font-size: 12px; font-weight: 650; letter-spacing: .22em; text-transform: uppercase; }
h1 img { width: 21px; height: 21px; }
#hint { margin: 0; font: 11px/1.4 "IBM Plex Mono", Consolas, monospace; color: #b1b1aa; letter-spacing: .055em; transition: opacity .65s; }
#hint.dismissed { opacity: 0; }
.dock {
  position: absolute; bottom: max(29px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; padding: 6px; gap: 12px;
  border: 1px solid #3a3a38; border-radius: 9px; background: #161616;
  box-shadow: 0 3px 16px #0006; user-select: none;
}
header, .dock {
  opacity: 0; visibility: hidden;
  transition: opacity .26s ease-out, translate .26s ease-out, visibility .26s;
}
header { translate: 0 -7px; }
.dock { translate: 0 10px; }
.controls-ready header, .controls-ready .dock { opacity: 1; visibility: visible; translate: 0; }
.cine header, .cine .dock, .cine #brush-cursor { display: none; }
.cine #portrait { cursor: default; }
.modes, .actions { display: flex; align-items: center; gap: 2px; }
button {
  height: 39px; border: 0; border-radius: 5px; padding: 0 13px; background: transparent;
  color: #bdbeb9; font: 500 12px/1 "Inter", "Segoe UI", Arial, sans-serif; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  transition: color .14s, background .14s;
}
button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linejoin: round; stroke-linecap: round; }
button:hover { color: white; background: #282827; }
.modes [aria-pressed=true] { background: var(--acid); color: #17180d; }
.actions [aria-pressed=true] { color: var(--acid); }
.actions [aria-pressed=true] svg { filter: drop-shadow(0 0 4px #e7ec3c22); }
.resolution {
  padding: 0 18px; height: 30px; display: grid; align-content: center; gap: 0;
  border-inline: 1px solid #3c3c39; color: #cccfc6; font-size: 10px; letter-spacing: .035em;
}
input[type=range] { width: 96px; margin: 0; height: 17px; cursor: ew-resize; appearance: none; background: transparent; }
input[type=range]::-webkit-slider-runnable-track { height: 2px; border-radius: 1px; background: linear-gradient(to right, var(--acid) var(--fill), #54554f var(--fill)); }
input[type=range]::-moz-range-track { height: 2px; background: #54554f; }
input[type=range]::-moz-range-progress { height: 2px; background: var(--acid); }
input[type=range]::-webkit-slider-thumb { appearance: none; margin-top: -3px; width: 8px; height: 8px; border-radius: 1px; background: #e6e7de; }
input[type=range]::-moz-range-thumb { width: 8px; height: 8px; border: 0; border-radius: 1px; background: #e6e7de; }
:focus-visible { outline: 2px solid var(--acid); outline-offset: 2px; }
#status { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: #ddd; text-align: center; font-size: 14px; }
@media (max-width: 650px) {
  header { top: max(23px, env(safe-area-inset-top)); left: 20px; right: 20px; }
  h1 { font-size: 10px; gap: 8px; }
  h1 img { width: 18px; height: 18px; }
  #hint { font-size: 10px; }
  .dock { width: min(calc(100% - 36px), 392px); bottom: max(19px, env(safe-area-inset-bottom)); padding: 6px; display: grid; grid-template-columns: 1fr auto; gap: 3px 4px; }
  .modes { grid-column: 1 / -1; padding-bottom: 5px; border-bottom: 1px solid #363633; }
  .modes button { flex: 1; }
  button { height: 42px; padding: 0 12px; }
  .resolution { height: 42px; padding: 0 10px; border: 0; gap: 1px; }
  input[type=range] { width: 100%; height: 19px; }
  .actions button { padding: 0 7px; gap: 4px; }
}
@media (max-height: 470px) and (min-aspect-ratio: 1/1) {
  header { top: 12px; }
  .dock { bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
