:root {
  color-scheme: light;
  --ink: #1c2925;
  --muted: #52625b;
  --line: #d5ded7;
  --wash: #f2f5f0;
  --green: #235944;
  --hint: #fff;
  --shadow: 0 2px 8px #1938290b, 0 8px 32px #19382909;
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: #fff;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  outline-offset: 3px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
#stage:focus-visible {
  outline: 3px solid #44735b;
}
button {
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-weight: 550;
  min-height: 38px;
  padding: 6px 10px;
}
button:hover {
  background: var(--wash);
}
button:disabled {
  cursor: wait;
  opacity: 0.58;
}
.primary {
  background: var(--green);
  color: white;
  padding-inline: 17px;
}
.primary:hover {
  background: #174a35;
}
.surface {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fffffff8;
  box-shadow: var(--shadow);
}
header {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 9px 20px;
  border-bottom: 1px solid var(--line);
  position: relative;
  background: white;
  z-index: 2;
}
.brand {
  font-size: 19px;
  letter-spacing: -0.7px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mark {
  display: grid;
  grid-template-columns: repeat(3, 3px);
  gap: 2px;
  align-items: center;
  justify-content: center;
  transform: rotate(-8deg);
  height: 27px;
  width: 27px;
  border-radius: 7px;
  background: var(--green);
}
.mark i {
  display: block;
  background: #fff;
  width: 3px;
  height: 13px;
  border-radius: 2px;
  transform: skew(-16deg);
}
.mark i:nth-child(2) {
  height: 17px;
}
.title {
  border-left: 1px solid var(--line);
  border-radius: 0;
  padding-left: 14px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  max-width: min(26vw, 420px);
  text-align: left;
  color: var(--muted);
}
.mode {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--wash);
  padding: 3px;
  margin-inline: auto;
}
.mode button {
  min-height: 30px;
  font-size: 13px;
}
.mode [aria-pressed="true"] {
  background: #fff;
  box-shadow: 0 1px 4px #102b201c;
}
.head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.head-actions span + span {
  margin-left: 5px;
}
main {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
#stage {
  position: absolute;
  inset: 0;
  touch-action: none;
  overflow: hidden;
  background: white;
}
#stage:focus-visible {
  outline-offset: -4px;
}
#drawing,
#overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
  object-fit: contain;
}
#drawing:not([src]) {
  display: none;
}
#blank {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 15px;
  line-height: 1.5;
  max-width: 310px;
  width: 70%;
  color: var(--muted);
  text-align: center;
  pointer-events: none;
}
.tools {
  position: absolute;
  top: 18px;
  left: 18px;
  display: grid;
  padding: 4px;
  gap: 2px;
}
.tools button {
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  font-size: 13px;
}
.tools b {
  font-family: Arial, sans-serif;
  font-weight: 400;
  font-size: 22px;
  line-height: 1;
  width: 24px;
  text-align: center;
}
.tools [aria-pressed="true"] {
  background: #e4eee6;
  color: #204c37;
}
.camera {
  position: absolute;
  right: 16px;
  bottom: 16px;
  padding: 3px;
  display: flex;
}
.camera button {
  min-width: 38px;
}
#discovery {
  position: absolute;
  bottom: 18px;
  left: 18px;
  color: var(--muted);
  font-size: 12px;
  text-underline-offset: 3px;
}
.context {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}
.context button,
#status {
  background: #f2f6ee;
  color: #254933;
  border: 1px solid #c3d3c4;
}
.context button {
  font-size: 12px;
}
#status {
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  max-width: 80%;
  text-align: center;
  pointer-events: none;
}
dialog {
  margin: auto;
  width: min(420px, calc(100% - 24px));
  max-height: 85dvh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  padding: 20px;
  box-shadow: 0 18px 70px #163d292f;
}
dialog::backdrop {
  background: #24382c35;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}
.panel-head h1 {
  font-size: 20px;
  letter-spacing: -0.6px;
  margin: 0;
}
.panel-head button {
  font-size: 23px;
}
#panelBody {
  display: grid;
  gap: 9px;
}
#panelBody button {
  text-align: left;
  border: 1px solid var(--line);
  min-height: 42px;
}
#panelBody label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
}
#panelBody p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}
#panelBody input,
#panelBody textarea,
#panelBody select {
  color: var(--ink);
  width: 100%;
  border: 1px solid #a7b6ab;
  border-radius: 6px;
  padding: 9px;
  background: white;
}
#panelBody textarea {
  resize: vertical;
  min-height: 90px;
}
#panelBody .primary {
  text-align: center;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
[hidden] {
  display: none !important;
}
@media (max-width: 700px) {
  header {
    min-height: 102px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 3px 8px;
    padding: 6px 10px;
  }
  .brand {
    font-size: 16px;
    gap: 5px;
  }
  .title {
    max-width: 100%;
    font-size: 13px;
    padding: 4px 6px;
  }
  .head-actions {
    grid-column: 3;
    grid-row: 1;
    gap: 2px;
  }
  .head-actions button {
    padding-inline: 8px;
    min-height: 40px;
  }
  .mode {
    grid-column: 1/-1;
    grid-row: 2;
    justify-self: center;
  }
  .mode button {
    min-height: 32px;
    padding-inline: 20px;
  }
  .tools {
    top: auto;
    bottom: calc(38px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    display: flex;
  }
  .tools button {
    display: grid;
    justify-items: center;
    gap: 3px;
    font-size: 11px;
    min-width: 52px;
    padding: 5px 8px;
  }
  .tools b {
    font-size: 20px;
  }
  .camera {
    top: 10px;
    bottom: auto;
    right: 10px;
  }
  .camera button {
    min-width: 36px;
  }
  .context {
    top: 64px;
    width: max-content;
    max-width: 90%;
    flex-wrap: wrap;
    justify-content: center;
  }
  #discovery {
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
  }
  #status {
    width: max-content;
    bottom: calc(111px + env(safe-area-inset-bottom));
  }
  .tools[hidden] ~ #status {
    bottom: 46px;
  }
}
