* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
:root {
  font-family:
    "Malgun Gothic",
    Apple SD Gothic Neo,
    sans-serif;
  color: #242d37;
  background: #f6f8fb;
  word-break: keep-all;
  --teal: #006866;
  --line: #ccd6db;
}
body {
  margin: 0;
}
header,
main,
footer {
  width: min(1152px, 94%);
  margin: auto;
}
header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
a {
  color: var(--teal);
  text-underline-offset: 3px;
}
header a {
  display: flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  font-size: 0.9rem;
}
header a:first-child {
  font-weight: 750;
  color: inherit;
}
h1 {
  font-size: clamp(1.7rem, 4vw, 3.2rem);
  letter-spacing: -0.075em;
  line-height: 1.16;
  margin: clamp(22px, 4vw, 44px) 0 6px;
}
.lede {
  margin: 0 0 22px;
  color: #536470;
}
.desk {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(280px, 1fr);
  align-items: start;
  gap: 22px;
}
.bench {
  background: #27333c;
  color: white;
  border-radius: 14px;
  overflow: hidden;
}
.titlebar,
.film,
.viewtools,
.row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.titlebar {
  padding: 5px 14px;
  justify-content: space-between;
  font-size: 0.92rem;
}
.titlebar button {
  background: transparent;
  color: white;
  border: none;
}
.titlebar button[aria-pressed="true"] {
  background: #d9fbf2;
  color: #164844;
}
#stage {
  position: relative;
  display: grid;
  place-items: center;
  background: #182129;
  overflow: hidden;
  height: clamp(240px, 48vw, 480px);
}
#view {
  touch-action: none;
  cursor: crosshair;
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transform-origin: center;
}
#empty {
  padding: 18px;
  text-align: center;
  color: #fff;
}
#stage.pan canvas {
  cursor: grab;
}
.film {
  padding: 10px;
  gap: 10px;
}
.film label {
  width: 50%;
  min-width: 0;
  display: flex;
  align-items: center;
  position: relative;
  gap: 10px;
  border: 1px solid #65737e;
  border-radius: 6px;
  padding: 8px;
  cursor: pointer;
  overflow: hidden;
}
.film label:focus-within {
  outline: 3px solid #79e1d8;
}
.film input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.film label > span:last-child {
  min-width: 0;
}
.film b,
.film small {
  display: block;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}
.film b {
  font-size: 0.85rem;
}
.film small {
  font-size: 0.75rem;
  color: #c6d8db;
  margin-top: 3px;
}
.thumb {
  width: 40px;
  height: 40px;
  background: #40505d center/cover;
  flex: none;
  border-radius: 3px;
}
.controls {
  padding: 18px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.tabs {
  display: flex;
  background: #edf2f5;
  padding: 4px;
  border-radius: 8px;
}
.tabs button {
  flex: 1;
  border: 0;
  background: transparent;
}
.tabs button[aria-pressed="true"] {
  background: #fff;
  color: #005956;
  box-shadow: 0 1px 5px #1a424031;
}
button {
  font: inherit;
  font-size: 0.86rem;
  font-weight: 650;
  min-height: 42px;
  border-radius: 6px;
  background: white;
  border: 1px solid var(--line);
  cursor: pointer;
  padding: 6px 10px;
  color: inherit;
}
button[aria-pressed="true"] {
  background: #d9f4eb;
  color: #075e55;
  border-color: #479388;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #098882;
  outline-offset: 2px;
}
#hint,
.notes p {
  font-size: 0.93rem;
  line-height: 1.65;
  color: #4d5c68;
}
.controls label {
  font-size: 0.87rem;
  font-weight: bold;
  display: block;
  margin: 16px 0;
}
.controls label output {
  float: right;
  font-weight: 500;
}
.controls input[type="range"] {
  display: block;
  width: 100%;
  height: 30px;
  accent-color: var(--teal);
}
.row {
  flex-wrap: wrap;
}
.viewtools {
  border-top: 1px solid var(--line);
  margin: 18px 0 12px;
  padding-top: 14px;
  font-size: 0.82rem;
  flex-wrap: wrap;
}
.viewtools button {
  min-width: 40px;
}
.viewtools span {
  margin-right: auto;
}
.exports {
  display: grid;
  gap: 7px;
}
.exports #save {
  background: var(--teal);
  color: white;
  border-color: var(--teal);
  min-height: 46px;
}
#status {
  margin: 10px 0 0;
  font-size: 0.86rem;
  color: var(--teal);
}
#status:empty {
  display: none;
}
#status[data-error="true"] {
  color: #9d3125;
}
.notes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  padding: 22px 0;
}
.notes h2 {
  font-size: 1rem;
}
.notes p {
  margin: 0.45em 0;
}
.notes a,
footer {
  font-size: 0.84rem;
}
footer {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
aside {
  margin: 16px 0;
  text-align: center;
  color: #697784;
}
@media (max-width: 750px) {
  .desk {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  #stage {
    height: clamp(200px, 58vw, 350px);
  }
  .notes {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .controls {
    padding: 13px;
  }
  .thumb {
    width: 30px;
    height: 34px;
  }
  .film {
    gap: 6px;
    padding: 7px;
  }
  .film label {
    gap: 6px;
    padding: 6px;
  }
  .film b {
    font-size: 0.79rem;
  }
  .lede {
    font-size: 0.9rem;
    margin-bottom: 15px;
  }
  header {
    height: 48px;
  }
  .viewtools {
    margin-top: 12px;
  }
}
#brush-tip {
  pointer-events: none;
  position: absolute;
  border: 1.5px solid white;
  border-radius: 50%;
  box-shadow:
    0 0 0 1px #26333c,
    inset 0 0 0 1px #26333c;
  transform: translate(-50%, -50%);
}
