:root {
  color-scheme: dark;
  font:
    15px system-ui,
    sans-serif;
  color: #edf1ef;
  background: #171b1c;
  --line: #3d4748;
  --accent: #c4e1b7;
  --muted: #aabbb4;
}
.paper-camera {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
  border: 0;
  border-radius: 0;
  background: #111718;
  color: #edf1ef;
  display: flex;
  flex-direction: column;
}
.paper-camera:not([open]) {
  display: none;
}
.camera-heading {
  padding: 7px 12px;
  margin: 0;
}
.paper-stage {
  position: relative;
  flex: 1;
  min-height: 100px;
  touch-action: none;
  overflow: hidden;
}
#paper-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  width: fit-content;
  background: #101616d9;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  pointer-events: none;
}
.paper-controls {
  padding: 6px 12px;
  max-height: 46dvh;
  overflow-y: auto;
}
.paper-controls p {
  font-size: 12px;
  margin: 3px 0 8px;
}
.paper-controls .slider {
  margin-bottom: 8px;
}
#paper-native {
  min-height: 38px;
  font-size: 12px;
  background: transparent;
  border-color: transparent;
}
small a {
  color: #c4e1b7;
}
@media (orientation: landscape) and (max-height: 560px) {
  .paper-camera {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 36%);
    grid-template-rows: auto minmax(0, 1fr);
  }
  .camera-heading {
    grid-column: 1 / -1;
  }
  .paper-stage {
    min-height: 0;
  }
  .paper-controls {
    max-height: none;
  }
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
body {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
}
button,
select,
input {
  font: inherit;
}
button,
select {
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #252d2e;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
button {
  line-height: 1.2;
}
button:disabled,
select:disabled {
  opacity: 0.4;
  cursor: default;
}
button:focus-visible,
select:focus-visible,
input:focus-visible,
main:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button:active {
  filter: brightness(1.2);
}
button.primary {
  background: var(--accent);
  color: #19221a;
  border-color: var(--accent);
  font-weight: 650;
}
button[aria-pressed='true'] {
  border-color: var(--accent);
  color: var(--accent);
  background: #344434;
}
header {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 7px 10px;
}
#project-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--muted);
}
#hide-ui {
  background: #344434;
  border-color: #71866c;
  color: #dbefcf;
}
#viewer {
  position: relative;
  flex: 1;
  min-height: 80px;
  overflow: hidden;
  touch-action: none;
  background: #121616;
  user-select: none;
  outline-offset: -3px;
}
canvas,
#grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#grid {
  display: none;
  background-image:
    linear-gradient(to right, #fff 1px, transparent 1px),
    linear-gradient(to bottom, #fff 1px, transparent 1px);
}
#image-label {
  position: absolute;
  top: 12px;
  left: 12px;
  max-width: calc(100% - 75px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 5px 8px;
  background: #111b;
  border-radius: 6px;
  font-size: 11px;
  letter-spacing: 0.07em;
  pointer-events: none;
}
#empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px;
}
.eyebrow {
  letter-spacing: 0.22em;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 18px;
}
h1 {
  font-size: clamp(25px, 5vw, 40px);
  font-weight: 550;
  line-height: 1.2;
  margin: 0;
}
p {
  color: #bcc8c4;
  line-height: 1.45;
}
small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 16px;
}
h2 {
  font-size: 20px;
  margin: 0;
}
#controls {
  padding: 10px 12px;
  background: #171b1c;
  max-height: 55dvh;
  overflow-y: auto;
  border-top: 1px solid #35403b;
}
.row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.row > h2,
.row > strong,
.grow {
  flex: 1;
  min-width: 0;
}
.stack {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}
.navigation {
  margin: 0;
}
.navigation button {
  flex: 1;
  background: transparent;
  border-color: transparent;
  color: #bbccc3;
}
#compare {
  min-height: 54px;
  font-size: 17px;
}
#comparison-button,
#versions-button {
  font-size: 13px;
}
.step-label {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--accent);
}
.hint,
#marks-instruction {
  font-size: 12px;
  margin: 6px 0 9px;
  line-height: 1.4;
}
#align-hint {
  margin-bottom: 0;
}
#align-more {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
#align-more .row {
  flex-wrap: wrap;
}
#align-more button {
  flex: 1;
}
#fine-controls output {
  font-size: 13px;
}
#tool-lock {
  font-size: 12px;
  min-width: 66px;
}
#tool-lock[aria-pressed='true'] {
  color: #edca8f;
  border-color: #ab8b56;
  background: #393327;
}
#fine-toggle {
  font-size: 13px;
}
.slider {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  min-height: 44px;
}
.slider input {
  flex: 1;
  min-width: 40px;
  accent-color: var(--accent);
}
dialog {
  border: 1px solid #53605b;
  border-radius: 20px 20px 0 0;
  background: #1c2324;
  color: inherit;
  padding: 18px 18px max(18px, env(safe-area-inset-bottom));
  width: min(500px, 100%);
  max-height: 85dvh;
  overflow: auto;
  margin: auto auto 0;
  box-shadow: 0 -12px 80px #0005;
}
dialog::backdrop {
  background: #0009;
}
dialog > .row {
  position: sticky;
  top: -18px;
  padding: 6px 0 10px;
  background: #1c2324;
  z-index: 1;
}
dialog label:not(.slider) {
  display: block;
  margin: 15px 0;
}
dialog label > select {
  display: block;
  width: 100%;
  margin-top: 7px;
}
dialog button {
  text-align: left;
}
#close-panel {
  text-align: center;
  flex: none;
}
dialog input[type='text'] {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #131819;
  color: inherit;
}
.muted {
  font-size: 13px;
  color: var(--muted);
}
.danger {
  color: #ffb7aa;
}
.project-entry {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.project-entry strong {
  display: block;
  overflow-wrap: anywhere;
  margin-bottom: 4px;
}
.project-entry button {
  margin: 0 8px 5px 0;
}
#versions button {
  display: flex;
  gap: 12px;
  align-items: center;
}
#versions img {
  width: 36px;
  height: 44px;
  object-fit: contain;
  border-radius: 4px;
  background: #121616;
}
#notice {
  position: fixed;
  z-index: 20;
  top: 65px;
  left: 5%;
  width: 90%;
  max-height: 40dvh;
  overflow: auto;
  background: #663d28;
  padding: 16px;
  border: 1px solid #e6ba92;
  border-radius: 12px;
  cursor: pointer;
}
.float {
  position: absolute;
  min-width: 44px;
  background: #1c2324d9;
  border-color: #69756b;
  font-size: 14px;
  backdrop-filter: blur(6px);
}
.help {
  bottom: 12px;
  right: 12px;
  border-radius: 50%;
  font-weight: 600;
}
.info {
  top: 8px;
  right: 10px;
  border-color: transparent;
  background: #121616a6;
  font-size: 18px;
}
#restore {
  top: 10px;
  right: 10px;
}
#quiet-compare {
  position: absolute;
  bottom: 18px;
  left: 12px;
  right: 92px;
  min-height: 56px;
  background: #d4e9c9ed;
  color: #19221a;
  border-color: #c4e1b7;
  font-weight: 650;
  box-shadow: 0 3px 16px #0006;
}
#quiet-marks {
  bottom: 18px;
  right: 12px;
  width: 68px;
  min-height: 56px;
}
@media (min-width: 800px) {
  #quiet-compare {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 360px;
  }
}
body.quiet header,
body.quiet #controls,
body.quiet .help,
body.quiet .info {
  display: none !important;
}
#blend-control {
  position: absolute;
  bottom: 65px;
  left: 12px;
  right: 12px;
  padding: 8px 12px;
  background: #171b1ce8;
  border-radius: 10px;
  max-width: 440px;
  margin: auto;
}
#blend-target {
  max-width: 30%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.quiet #blend-control {
  bottom: 86px;
}
#marks-actions {
  flex-wrap: wrap;
}
#marks-actions button {
  flex: 1;
  min-width: 100px;
  font-size: 13px;
}
#loupe {
  width: 130px;
  height: 130px;
  left: auto;
  bottom: auto;
  right: 10px;
  top: 10px;
  border: 2px solid #d5e8b9;
  border-radius: 50%;
  box-shadow: 0 2px 12px #000;
  background: #fff;
}
.mark-example {
  position: relative;
  height: 145px;
  background: #eee7d6;
  border-radius: 12px;
  margin: 16px 0;
  color: #b52f37;
}
.mark-example span {
  position: absolute;
  display: grid;
  gap: 3px;
  font-size: 12px;
  text-align: center;
}
.mark-example span:nth-child(1) {
  left: 12%;
  top: 10px;
}
.mark-example span:nth-child(2) {
  right: 12%;
  top: 10px;
}
.mark-example span:nth-child(3) {
  left: 44%;
  bottom: 8px;
}
.mark-example b {
  font-size: 27px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
#panel-body > button,
.version-link {
  display: block;
  width: 100%;
  margin: 8px 0;
}
.version-link {
  padding: 14px 4px;
  color: var(--accent);
  font-size: 13px;
}
#comparison-settings label {
  display: block;
}
body.marking .navigation,
body.planning .navigation,
body.detailing .navigation,
body.adjusting .navigation {
  display: none;
}
body.marking #grid {
  visibility: hidden;
}
@media (min-width: 800px) {
  #controls {
    width: 600px;
    align-self: center;
  }
  dialog {
    margin: auto;
    border-radius: 20px;
  }
}
@media (orientation: landscape) and (max-height: 550px) {
  body {
    display: grid;
    grid-template-columns: 1fr 280px;
    grid-template-rows: 58px 1fr;
  }
  header {
    grid-column: 1/3;
  }
  #viewer {
    grid-row: 2;
  }
  #controls {
    width: auto;
    grid-column: 2;
    grid-row: 2;
    max-height: none;
    padding: 9px;
  }
  body.quiet {
    display: flex;
  }
  #compare {
    font-size: 15px;
  }
  .navigation button {
    padding: 8px;
  }
  dialog {
    margin: auto;
    border-radius: 20px;
    max-height: 94dvh;
  }
}
