:root {
  --bg: #e7e5e4;
  --ink: #082f49;
  --accent: #0369a1;
  --muted: #57534e;
  --line: #d6d3d1;
  --card: #f5f4f1;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    17px/1.5 ui-serif,
    Georgia,
    serif;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
.wrap {
  max-width: 1080px;
  margin: auto;
  padding: 1.5rem 1.25rem 2rem;
}
header.site {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}
header img {
  display: block;
}
nav {
  display: flex;
  gap: 1.25rem;
}
nav a {
  color: var(--muted);
  font-size: 0.95rem;
}
nav [aria-current] {
  color: var(--ink);
}
h1 {
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.25rem;
}
h2 {
  font-size: 1.35rem;
  font-weight: 500;
  margin: 0 0 0.5rem;
}
p {
  margin: 0 0 1rem;
}
.lede {
  color: var(--muted);
  margin: 0;
}
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.local {
  font:
    12px ui-monospace,
    monospace;
  color: #326b5d;
  white-space: nowrap;
}
.drop-zone {
  text-align: center;
  border: 1px dashed #a8a29e;
  border-radius: 8px;
  background: var(--card);
  padding: 3.5rem 1rem;
}
.drop-zone.dragging {
  outline: 3px solid var(--accent);
  background: #e3edf0;
}
.sample-icon {
  font-size: 3rem;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 1.25rem;
}
.drop-zone .small {
  margin: 1.25rem 0 0;
}
button,
select {
  font: inherit;
  font-size: 0.86rem;
  border: 1px solid #b8b5b1;
  border-radius: 4px;
  background: var(--card);
  color: var(--ink);
  padding: 0.48rem 0.8rem;
  min-height: 38px;
}
button {
  cursor: pointer;
}
button:hover:not(:disabled) {
  border-color: var(--ink);
  background: #eeece7;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
.primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}
button.primary:hover:not(:disabled) {
  background: #0c4a6e;
}
.small,
.hint {
  font-size: 0.79rem;
  color: var(--muted);
}
.status {
  font-size: 0.85rem;
  margin: 0.6rem 0;
  min-height: 1.3em;
}
.status:empty {
  display: none;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 1rem;
  background: var(--card);
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 6px 6px 0 0;
}
.group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 120px;
  font-size: 0.78rem;
  color: var(--muted);
}
.group:first-child {
  flex: 0;
}
output {
  float: right;
  font-family: ui-monospace, monospace;
  color: var(--ink);
}
input[type="range"] {
  width: 100%;
  accent-color: var(--ink);
  height: 32px;
  margin: 0;
}
input[type="color"] {
  width: 100%;
  height: 38px;
  background: transparent;
  border: 1px solid var(--line);
}
.segmented {
  display: flex;
}
.segmented button {
  border-radius: 0;
}
.segmented button:first-child {
  border-radius: 4px 0 0 4px;
}
.segmented button:last-child {
  border-radius: 0 4px 4px 0;
  border-left: 0;
}
.segmented [aria-pressed="true"] {
  background: var(--ink);
  color: white;
}
.workspace {
  height: clamp(260px, 52dvh, 620px);
  background: repeating-conic-gradient(#d7d4cf 0% 25%, #dedbd7 0% 50%) 50%/18px
    18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-top: 0;
  overflow: hidden;
  padding: 12px;
}
.canvas-wrap {
  position: relative;
  flex: none;
  box-shadow: 0 3px 18px #082f4920;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
}
#overlay {
  position: absolute;
  inset: 0;
  touch-action: none;
  cursor: crosshair;
}
#overlay:focus-visible {
  outline-offset: 3px;
}
.edit-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
  padding: 0.75rem 0;
}
.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.export-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}
.export-bar p {
  margin: 0;
}
#dimensions {
  font-size: 0.85rem;
  font-family: ui-monospace, monospace;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
}
button:focus-visible,
select:focus-visible,
input:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
@media (max-width: 640px) {
  .wrap {
    padding: 1rem 0.85rem;
  }
  .heading {
    align-items: start;
    flex-direction: column;
    gap: 0.6rem;
  }
  .heading .local {
    font-size: 11px;
  }
  .toolbar {
    gap: 0.7rem;
    padding: 0.75rem;
  }
  .group {
    flex-basis: 40%;
    min-width: 100px;
  }
  .group:first-child {
    flex: 1;
    flex-basis: 40%;
  }
  .workspace {
    height: 42dvh;
    min-height: 240px;
  }
  .edit-actions,
  .export-bar {
    align-items: start;
    flex-direction: column;
    gap: 0.65rem;
  }
  .drop-zone {
    padding: 2.5rem 1rem;
  }
  button,
  select {
    min-height: 42px;
  }
  footer {
    font-size: 0.73rem;
  }
  .export-bar .buttons {
    width: 100%;
  }
  #download {
    flex: 1;
  }
}
