:root {
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  color: #173048;
  background: #f7fafd;
  font-size: 15px;
  line-height: 1.5;
  font-synthesis: none;
  --line: #cad7e3;
  --blue: #2767a7;
  --muted: #536a80;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
textarea,
summary {
  outline-offset: 4px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid #2767a7;
}
button {
  border: 1px solid #b5c6d5;
  background: #fff;
  border-radius: 5px;
  padding: 8px 13px;
  cursor: pointer;
  line-height: 1.25;
}
button:hover:not(:disabled) {
  background: #eef5fc;
  border-color: #6a8fad;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
a {
  color: var(--blue);
  text-underline-offset: 3px;
}
button.primary,
button.export {
  background: #173048;
  color: white;
  border-color: #173048;
  font-weight: 600;
}
button.primary:hover,
button.export:hover {
  background: #294d6d;
  color: white;
}
button.quiet {
  border-color: transparent;
  background: transparent;
}
.masthead {
  max-width: 1480px;
  padding: 22px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: auto;
}
.brand {
  color: #173048;
  text-decoration: none;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -1px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.brand span {
  font-weight: 400;
  letter-spacing: -0.5px;
  margin-left: -7px;
  color: #4c6c88;
}
.brand svg {
  width: 30px;
  height: 30px;
}
.masthead nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.masthead nav a {
  text-decoration: none;
  font-size: 14px;
}
main {
  max-width: 1480px;
  margin: auto;
  padding: 0 40px 28px;
}
.intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 22px 0 30px;
  gap: 30px;
}
.intro h1 {
  font-family: Georgia, serif;
  letter-spacing: -1.4px;
  font-size: clamp(30px, 3.3vw, 46px);
  font-weight: 400;
  line-height: 1.08;
  margin: 0;
}
.intro h1 br {
  display: none;
}
.intro p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
}
.intro .local-note {
  font-size: 13px;
  text-align: right;
  border-left: 2px solid #93b3d0;
  padding-left: 20px;
  line-height: 1.6;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.open-actions,
.history-actions {
  display: flex;
  gap: 6px;
}
.history-actions {
  margin-left: auto;
}
.workbench {
  display: grid;
  grid-template-columns: 190px minmax(280px, 1fr) 238px;
  min-height: 480px;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--line);
  background: white;
  border-radius: 7px;
  overflow: hidden;
}
.elements {
  padding: 19px 12px;
  border-right: 1px solid var(--line);
}
h2 {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.2px;
  margin: 0;
}
.rail-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}
.rail-title span {
  font-size: 11px;
  color: var(--muted);
}
.hint {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  margin: 8px 0 14px;
}
.element-list {
  max-height: 420px;
  overflow: auto;
}
.element-list button {
  display: block;
  width: 100%;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  padding: 8px;
  border: 1px solid transparent;
  background: transparent;
  margin-bottom: 2px;
}
.element-list button.active {
  background: #fff0bd;
  border-color: #e1c573;
  color: #312b1d;
}
.element-list button small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}
.drawing-area {
  background: #e8eff6;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.canvas-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  padding: 9px 16px;
}
.canvas-meta #filename {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.canvas-meta button {
  font-size: 12px;
  padding: 6px;
}
.stage {
  position: relative;
  flex: 1;
  min-height: 330px;
  margin: 0 20px 0;
  background-color: #dfe9f2;
  background-image: radial-gradient(#a7bbcd 0.65px, transparent 0.65px);
  background-size: 12px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.stage iframe {
  width: 100%;
  height: 100%;
  min-height: 330px;
  position: absolute;
  inset: 0;
  border: 0;
  user-select: none;
}
.stage #selectionBox {
  position: absolute;
  pointer-events: none;
  border: 1.5px solid #2767a7;
  box-shadow: 0 0 0 2px #ffe18c;
  min-width: 2px;
  min-height: 2px;
}
.canvas-footer {
  font-size: 10px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 20px;
}
.inspector {
  padding: 18px 16px;
  border-left: 1px solid var(--line);
}
.selection-name {
  font-size: 13px;
  padding: 6px 8px;
  background: #f1f5f9;
  border-left: 3px solid #cad7e3;
  min-height: 32px;
  overflow-wrap: anywhere;
  margin: 12px 0 18px;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 18px;
  min-width: 0;
}
legend {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}
.nudge-pad {
  display: grid;
  grid-template-columns: 35px 35px 35px;
  grid-template-rows: 30px 30px 30px;
  gap: 3px;
  justify-content: center;
  margin: 6px auto 12px;
}
.nudge-pad button {
  padding: 0;
  font-size: 20px;
}
.up {
  grid-column: 2;
  grid-row: 1;
}
.left {
  grid-column: 1;
  grid-row: 2;
}
.right {
  grid-column: 3;
  grid-row: 2;
}
.down {
  grid-column: 2;
  grid-row: 3;
}
.pad-center {
  grid-column: 2;
  grid-row: 2;
  text-align: center;
  color: #86a0b5;
}
.move-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}
.move-inputs label {
  font-size: 11px;
  color: var(--muted);
}
input,
textarea {
  border: 1px solid #b5c6d5;
  border-radius: 4px;
  background: white;
  padding: 7px;
  width: 100%;
  line-height: 1.3;
}
input:disabled,
textarea:disabled {
  background: #f1f5f9;
}
input[type="number"] {
  min-width: 0;
}
.wide {
  width: 100%;
  font-size: 12px;
}
textarea {
  resize: vertical;
  font-size: 12px;
}
.png-controls {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  font-size: 11px;
}
.png-controls > div {
  display: flex;
  gap: 7px;
  margin-top: 5px;
}
.png-controls input {
  width: 100%;
  min-width: 0;
}
.png-controls button {
  font-size: 12px;
}
.receipt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.receipt h2 {
  font-size: 19px;
  font-weight: 500;
}
.receipt p {
  font-size: 12px;
  color: var(--muted);
  margin: 5px 0 0;
}
.receipt > button {
  font-size: 12px;
}
.changes {
  width: 100%;
  font-size: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
}
.change {
  border-left: 3px solid #e1c573;
  padding: 6px 12px;
  background: #fffaf0;
  overflow-wrap: anywhere;
}
.change code {
  font-size: 11px;
  white-space: pre-wrap;
  display: block;
}
.change small {
  color: var(--muted);
}
.paste {
  margin: 18px 0;
  font-size: 13px;
}
.paste textarea {
  display: block;
  margin: 12px 0;
  width: 100%;
  font-family: ui-monospace, monospace;
}
.paste button {
  font-size: 12px;
}
footer {
  margin: 25px 0 0;
  display: flex;
  justify-content: space-between;
  gap: 30px;
  font-size: 11px;
  color: var(--muted);
}
footer p {
  margin: 0;
  max-width: 720px;
}
footer a {
  white-space: nowrap;
  margin-right: 14px;
}
#error {
  background: #fff0ed;
  color: #8b3026;
  padding: 12px 16px;
  border-left: 3px solid #c15843;
  font-size: 13px;
}
.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;
}
@media (min-width: 1300px) {
  .stage {
    min-height: 420px;
  }
  .stage iframe {
    min-height: 420px;
  }
  .workbench {
    min-height: 530px;
  }
  .element-list {
    max-height: 465px;
  }
}
@media (max-width: 1050px) {
  main {
    padding: 0 20px 24px;
  }
  .masthead {
    padding: 18px 20px;
  }
  .workbench {
    grid-template-columns: 150px minmax(230px, 1fr) 200px;
  }
  .inspector {
    padding: 15px 12px;
  }
  .intro h1 {
    font-size: 35px;
  }
  .intro h1 br {
    display: block;
  }
  .canvas-footer {
    flex-direction: column;
    gap: 2px;
  }
}
@media (max-width: 760px) {
  .intro {
    margin: 12px 0 22px;
    gap: 15px;
    align-items: flex-start;
  }
  .intro h1 {
    font-size: 31px;
  }
  .intro p {
    font-size: 13px;
    max-width: 230px;
  }
  .intro .local-note {
    font-size: 10px;
    padding-left: 12px;
    max-width: 130px;
    margin-top: 5px;
  }
  .toolbar {
    flex-wrap: wrap;
    gap: 10px;
  }
  .toolbar button {
    font-size: 12px;
    padding: 8px 10px;
  }
  .history-actions {
    margin-left: auto;
  }
  .toolbar > .export {
    margin-left: auto;
  }
  .workbench {
    display: flex;
    flex-direction: column;
  }
  .drawing-area {
    order: 0;
  }
  .elements {
    order: 1;
    border: 0;
    border-top: 1px solid var(--line);
    padding: 15px 12px;
  }
  .element-list {
    max-height: 145px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px;
  }
  .element-list button {
    margin: 0;
  }
  .elements .hint {
    margin: 3px 0 8px;
  }
  .inspector {
    order: 2;
    border-left: 0;
    border-top: 1px solid var(--line);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 18px;
    padding: 17px;
  }
  .inspector > h2,
  .selection-name {
    grid-column: 1/-1;
    margin: 0;
  }
  .inspector fieldset {
    margin: 0;
  }
  .inspector #textHint {
    grid-column: 2;
    margin-top: -20px;
  }
  .png-controls {
    grid-column: 1/-1;
    display: flex;
    align-items: center;
    gap: 15px;
  }
  .png-controls > div {
    margin: 0;
    max-width: 240px;
  }
  .stage {
    height: 280px;
    min-height: 280px;
    margin: 0 12px;
  }
  .stage iframe {
    min-height: 280px;
  }
  .canvas-footer {
    flex-direction: row;
    font-size: 9px;
    padding: 10px 12px;
  }
  .receipt {
    margin-top: 20px;
  }
  .receipt h2 {
    font-size: 17px;
  }
  .receipt > button {
    font-size: 11px;
  }
  .changes {
    grid-template-columns: 1fr;
  }
  footer {
    flex-direction: column;
    gap: 10px;
  }
  .masthead nav {
    gap: 14px;
  }
  .brand {
    font-size: 23px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
.zoom-tools {
  display: flex;
  gap: 1px;
  flex-shrink: 0;
}
.canvas-meta .zoom-tools button {
  background: transparent;
  border-color: transparent;
  padding: 3px 6px;
  font-size: 12px;
}
.canvas-meta #filename {
  flex: 1;
  min-width: 0;
}
.canvas-meta #compare {
  flex-shrink: 0;
}
@media (max-width: 760px) {
  .canvas-meta {
    padding: 9px 10px;
    gap: 2px;
  }
  .canvas-meta #filename {
    font-size: 10px;
  }
  .canvas-meta #compare {
    font-size: 10px;
    padding: 5px 4px;
  }
  .canvas-meta .zoom-tools button {
    padding: 3px 5px;
    font-size: 11px;
  }
}
.change strong,
.change small {
  display: block;
}
.change strong {
  margin-bottom: 5px;
}
