:root {
  --tone-sun: #ffd60a;
  --tone-ink: #111111;
  --tone-paper: #fffdf3;
  --tone-hot: #ff3d68;
  --tone-sky: #1f4fff;
  --tone-mute: #5c5a4f;
  --rule: 3px;
  --throw: 5px;
  --loud-weight: 400;
  --face-loud: Impact, Haettenschweiler, "Arial Narrow Bold", "Roboto Condensed", sans-serif;
  --face-plain: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

.thin {
  --loud-weight: 900;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--tone-sun);
  color: var(--tone-ink);
  font: 16px/1.5 var(--face-plain);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--tone-sky);
  outline-offset: 2px;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
}

.ico {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.top {
  display: flex;
  align-items: center;
  gap: 8px 18px;
  flex-wrap: wrap;
  padding: 10px 18px;
  background: var(--tone-ink);
  color: var(--tone-paper);
}

.mark {
  margin: 0;
  padding: 0 10px;
  background: var(--tone-sun);
  color: var(--tone-ink);
  font: var(--loud-weight) 30px/1.25 var(--face-loud);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transform: rotate(-2deg);
}

.top h1 {
  margin: 0;
  flex: 1 1 240px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.local {
  margin: 0;
  padding: 2px 10px;
  border: 2px solid var(--tone-sun);
  color: var(--tone-sun);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tool {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 372px;
  gap: 22px;
  align-items: start;
  max-width: 1320px;
  margin: 22px auto 0;
  padding: 0 18px;
}

.bench {
  min-width: 0;
}

.strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.strip .push {
  margin-left: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 14px;
  border: var(--rule) solid var(--tone-ink);
  border-radius: 0;
  background: var(--tone-paper);
  box-shadow: 4px 4px 0 var(--tone-ink);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.06s, box-shadow 0.06s;
}

.btn:hover {
  background: #fff;
}

.btn:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 var(--tone-ink);
}

.btn:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
  box-shadow: 4px 4px 0 var(--tone-ink);
}

.btn.loud {
  background: var(--tone-ink);
  color: var(--tone-sun);
  box-shadow: 4px 4px 0 var(--tone-hot);
}

.btn.loud:active {
  box-shadow: 0 0 0 var(--tone-hot);
}

.btn.square {
  width: 44px;
  padding: 0;
}

.btn.wide {
  width: 100%;
}

.stagebox {
  padding: 16px;
  border: var(--rule) solid var(--tone-ink);
  background: var(--tone-paper);
  box-shadow: var(--throw) var(--throw) 0 var(--tone-ink);
}

.stagebox.over {
  background: #fff;
  box-shadow: var(--throw) var(--throw) 0 var(--tone-hot);
}

.fit {
  display: grid;
  justify-items: center;
  width: 100%;
  padding-top: 26px;
}

.stage {
  position: relative;
  line-height: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#view {
  display: block;
  outline: var(--rule) solid var(--tone-ink);
  background: repeating-conic-gradient(#e4e1d3 0 25%, #fff 0 50%) 0 0 / 20px 20px;
}

.guide {
  position: absolute;
  background: var(--tone-hot);
  pointer-events: none;
}

.guide.col {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  margin-left: -1px;
}

.guide.line {
  left: 0;
  right: 0;
  height: 2px;
  margin-top: -1px;
}

.frame {
  position: absolute;
  top: 0;
  left: 0;
  border: 2px dashed var(--tone-ink);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85);
  pointer-events: none;
}

.grip {
  position: absolute;
  width: 18px;
  height: 18px;
  border: var(--rule) solid var(--tone-ink);
  background: var(--tone-sun);
  pointer-events: auto;
}

.grip::before {
  content: "";
  position: absolute;
  inset: -12px;
}

.frame.live {
  border-style: solid;
  border-color: var(--tone-hot);
}

.ink {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: transparent;
  caret-color: var(--tone-hot);
  letter-spacing: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow: hidden;
  resize: none;
}

.ink:focus-visible {
  outline: 0;
}

.ink::selection {
  background: rgba(31, 79, 255, 0.4);
  color: transparent;
}

.cropbox {
  position: absolute;
  top: 0;
  left: 0;
  border: 2px dashed var(--tone-paper);
  box-shadow: 0 0 0 2px var(--tone-ink);
  pointer-events: none;
}

.cropbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.cropbar .size {
  margin-right: auto;
  font-size: 14px;
}

.grip.west {
  top: 50%;
  left: -10px;
  margin-top: -9px;
  cursor: ew-resize;
}

.grip.east {
  top: 50%;
  right: -10px;
  margin-top: -9px;
  cursor: ew-resize;
}

.grip.scale {
  right: -10px;
  bottom: -10px;
  background: var(--tone-paper);
  cursor: nwse-resize;
}

.grip.nw {
  top: -10px;
  left: -10px;
  cursor: nwse-resize;
}

.grip.ne {
  top: -10px;
  right: -10px;
  cursor: nesw-resize;
}

.grip.sw {
  bottom: -10px;
  left: -10px;
  cursor: nesw-resize;
}

.grip.se {
  right: -10px;
  bottom: -10px;
  cursor: nwse-resize;
}

.grip.turn {
  top: -38px;
  left: 50%;
  margin-left: -9px;
  border-radius: 50%;
  background: var(--tone-hot);
  cursor: grab;
}

.stem {
  position: absolute;
  top: -22px;
  left: 50%;
  width: 2px;
  height: 20px;
  margin-left: -1px;
  background: var(--tone-ink);
}

.hint,
.status {
  margin: 12px 0 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.hint {
  color: var(--tone-mute);
}

.status {
  min-height: 20px;
}

.panel {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
  border: var(--rule) solid var(--tone-ink);
  background: var(--tone-paper);
  box-shadow: var(--throw) var(--throw) 0 var(--tone-ink);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: var(--rule) solid var(--tone-ink);
}

.tab {
  min-height: 46px;
  border: 0;
  border-right: var(--rule) solid var(--tone-ink);
  border-radius: 0;
  background: var(--tone-paper);
  font: var(--loud-weight) 19px/1 var(--face-loud);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.tab:last-child {
  border-right: 0;
}

.tab[aria-selected="true"] {
  background: var(--tone-ink);
  color: var(--tone-sun);
}

.tab:focus-visible {
  outline-offset: -5px;
}

.pane {
  display: grid;
  gap: 14px;
  padding: 16px;
  overflow-y: auto;
}

.pane h2 {
  margin: 6px 0 -4px;
  font: var(--loud-weight) 18px/1.1 var(--face-loud);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pane h2:first-child {
  margin-top: 0;
}

.plain {
  display: grid;
  gap: 14px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.plain:disabled {
  opacity: 0.4;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  max-width: 100%;
  min-height: 36px;
  padding: 4px 10px;
  border: var(--rule) solid var(--tone-ink);
  border-radius: 0;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.chip[aria-pressed="true"] {
  background: var(--tone-sun);
  box-shadow: 3px 3px 0 var(--tone-ink);
}

.note {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--tone-mute);
}

.field {
  display: grid;
  gap: 5px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.field textarea,
.field select {
  width: 100%;
  padding: 9px 10px;
  border: var(--rule) solid var(--tone-ink);
  border-radius: 0;
  background: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.field textarea {
  min-height: 76px;
  resize: vertical;
}

.slide {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 46px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.slide input {
  width: 100%;
  height: 28px;
  margin: 0;
  accent-color: var(--tone-ink);
}

.slide output {
  font-weight: 700;
  text-align: right;
  text-transform: none;
  font-variant-numeric: tabular-nums;
}

.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.swatch {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.swatch input {
  flex: none;
  width: 48px;
  height: 36px;
  padding: 0;
  border: var(--rule) solid var(--tone-ink);
  border-radius: 0;
  background: #fff;
  cursor: pointer;
}

.tick {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 30px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
}

.tick input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0;
  border: var(--rule) solid var(--tone-ink);
  border-radius: 0;
  background: #fff;
  cursor: pointer;
}

.tick input:checked {
  background: var(--tone-ink);
  box-shadow: inset 0 0 0 3px var(--tone-sun);
}

.seg {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.seg legend {
  margin-bottom: 5px;
  padding: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.seg label {
  position: relative;
  flex: 1 1 0;
  margin-right: calc(var(--rule) * -1);
}

.seg label:last-child {
  margin-right: 0;
}

.seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.seg span {
  display: grid;
  place-items: center;
  min-height: 40px;
  padding: 4px 8px;
  border: var(--rule) solid var(--tone-ink);
  background: #fff;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
}

.seg input:checked + span {
  background: var(--tone-ink);
  color: var(--tone-sun);
}

.seg input:focus-visible + span {
  position: relative;
  z-index: 1;
  outline: 3px solid var(--tone-sky);
  outline-offset: 2px;
}

.trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.five {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.trio .btn,
.five .btn,
.duo .btn {
  padding: 6px 8px;
  font-size: 12px;
}

.five .btn {
  padding: 6px 2px;
}

.five .btn[aria-pressed="true"] {
  background: var(--tone-sun);
}

.size {
  margin: 0;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.copy {
  max-width: 780px;
  margin: 44px auto 0;
  padding: 0 18px;
}

.copy section {
  margin-bottom: 26px;
  padding: 20px 22px;
  border: var(--rule) solid var(--tone-ink);
  background: var(--tone-paper);
  box-shadow: var(--throw) var(--throw) 0 var(--tone-ink);
}

.copy h2 {
  display: inline-block;
  margin: 0 0 10px;
  padding: 0 8px;
  background: var(--tone-ink);
  color: var(--tone-sun);
  font: var(--loud-weight) 26px/1.3 var(--face-loud);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.copy h3 {
  margin: 16px 0 2px;
  font-size: 17px;
}

.copy p,
.copy ol,
.copy ul {
  margin: 0 0 10px;
}

.copy ol,
.copy ul {
  padding-left: 22px;
}

.copy li {
  margin-bottom: 6px;
}

kbd {
  padding: 1px 6px;
  border: 2px solid var(--tone-ink);
  background: #fff;
  font: 700 13px/1.4 ui-monospace, Menlo, Consolas, monospace;
}

.foot {
  padding: 8px 18px 40px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}


@media (max-width: 860px) {
  .top {
    padding: 8px 12px;
  }

  .mark {
    font-size: 24px;
  }

  .top h1 {
    flex-basis: 150px;
    font-size: 13px;
  }

  .local {
    display: none;
  }

  .tool {
    display: block;
    margin-top: 0;
    padding: 0 12px;
  }

  .bench {
    margin: 0 -12px;
    padding: 10px 12px 12px;
    border-bottom: var(--rule) solid var(--tone-ink);
    background: var(--tone-sun);
  }

  .strip {
    gap: 8px;
    margin-bottom: 10px;
  }

  .stagebox.full .hint {
    display: none;
  }

  .cropbar {
    margin-top: 8px;
  }

  .strip .btn {
    padding: 6px 10px;
  }

  .strip .btn.square {
    padding: 0;
  }

  .stagebox {
    padding: 10px;
  }

  .hint,
  .status {
    margin-top: 8px;
    font-size: 13px;
  }

  .panel {
    position: static;
    max-height: none;
    margin: 14px 0 0;
  }

  .pane {
    padding: 14px 12px;
    overflow: visible;
  }

  .copy {
    margin-top: 28px;
    padding: 0 12px;
  }

  .copy section {
    padding: 16px;
  }
}

@media (max-width: 860px) and (min-height: 620px) {
  .bench {
    position: sticky;
    top: 0;
    z-index: 5;
  }
}

@media (max-width: 520px) {
  .cropbar .size {
    flex-basis: 100%;
  }

  .cropbar .btn {
    flex: 1;
  }

  .strip .word {
    display: none;
  }

  .strip .btn {
    width: 44px;
    padding: 0;
  }

  .strip {
    gap: 6px;
  }

  .strip .btn.loud {
    width: auto;
    padding: 6px 10px;
  }

  .strip .btn.loud .word {
    display: inline;
  }
}

@media (max-width: 350px) {
  .strip .btn.loud {
    width: 44px;
    padding: 0;
  }

  .strip .btn.loud .word {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }
}

:root {
  --tone-sun: #FFFFFF;
  --tone-ink: #0A0A0A;
  --tone-paper: #FAF8F5;
  --tone-hot: #82633A;
  --tone-sky: #0A0A0A;
  --tone-mute: #5F5B55;
  --kb-field: #FFFFFF;
  --kb-edge: #ECE8E2;
  --kb-edge-2: #DCD6CD;
  --kb-press: #F4F1EC;
  --rule: 1px;
  --throw: 0px;
  --face-plain: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
:root[data-theme="dark"] {
  --tone-sun: #000000;
  --tone-ink: #FFFFFF;
  --tone-paper: #0F0E0D;
  --tone-hot: #C9AE8A;
  --tone-sky: #FFFFFF;
  --tone-mute: #A8A39C;
  --kb-field: #171614;
  --kb-edge: #24221F;
  --kb-edge-2: #35322E;
  --kb-press: #1C1A17;
  color-scheme: dark;
}
:focus-visible { outline: 2px solid var(--tone-ink); }
.top { display: block; max-width: 1240px; margin: 0 auto; padding: 48px 32px 24px; background: transparent; color: var(--tone-ink); }
.top h1 { font-size: clamp(30px, 4.6vw, 44px); line-height: 1.08; letter-spacing: -0.03em; font-weight: 650; max-width: 22ch; text-wrap: balance; }
.btn { border: 1px solid var(--kb-edge); border-radius: 12px; background: var(--kb-field); color: var(--tone-ink); box-shadow: none; font-family: var(--face-plain); font-weight: 500; text-transform: none; letter-spacing: 0; }
.btn:hover { background: var(--kb-field); border-color: var(--kb-edge-2); }
.btn:active { transform: none; box-shadow: none; }
.btn:disabled { box-shadow: none; }
.btn.loud { background: var(--tone-ink); color: var(--tone-sun); border-color: var(--tone-ink); box-shadow: none; }
.btn.loud:hover { background: var(--tone-ink); opacity: 0.86; }
.btn.loud:active { box-shadow: none; }
.stagebox { border: 1px solid var(--kb-edge); border-radius: 16px; background: var(--tone-paper); box-shadow: none; }
.stagebox.over { background: var(--kb-press); border-color: var(--tone-ink); box-shadow: none; }
#view { outline: 1px solid var(--kb-edge); background: repeating-conic-gradient(#EEEAE4 0 25%, #FFFFFF 0 50%) 0 0 / 20px 20px; }
.frame { border-color: var(--tone-hot); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85); }
.grip { border: 1px solid var(--tone-ink); border-radius: 4px; background: #FFFFFF; }
.grip.turn { border-radius: 50%; background: var(--tone-hot); border-color: var(--tone-hot); }
.panel { border: 1px solid var(--kb-edge); border-radius: 16px; background: var(--tone-paper); box-shadow: none; overflow: hidden; }
.tabs { border-bottom: 1px solid var(--kb-edge); }
.tab { border-right: 1px solid var(--kb-edge); background: var(--tone-paper); color: var(--tone-mute); font: 500 14px/1 var(--face-plain); letter-spacing: 0; text-transform: none; }
.tab[aria-selected="true"] { background: var(--tone-ink); color: var(--tone-sun); }
.pane h2 { font: 500 11.5px/1.2 ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace; letter-spacing: 0.04em; text-transform: lowercase; color: var(--tone-mute); }
.chip { border: 1px solid var(--kb-edge); border-radius: 999px; background: var(--kb-field); color: var(--tone-ink); font-weight: 500; }
.chip[aria-pressed="true"] { background: var(--tone-ink); color: var(--tone-sun); border-color: var(--tone-ink); box-shadow: none; }
.note { font-weight: 400; }
.field textarea, .field select { border: 1px solid var(--kb-edge); border-radius: 10px; background: var(--kb-field); color: var(--tone-ink); font-weight: 400; }
.swatch input { border: 1px solid var(--kb-edge); border-radius: 8px; background: var(--kb-field); }
.tick input { border: 1px solid var(--kb-edge-2); border-radius: 6px; background: var(--kb-field); }
.tick input:checked { background: var(--tone-ink); box-shadow: inset 0 0 0 3px var(--kb-field); }
.seg span { border: 1px solid var(--kb-edge); background: var(--kb-field); color: var(--tone-ink); font-weight: 500; }
.seg label:first-child span { border-radius: 10px 0 0 10px; }
.seg label:last-child span { border-radius: 0 10px 10px 0; }
.seg input:checked + span { background: var(--tone-ink); color: var(--tone-sun); border-color: var(--tone-ink); }
.five .btn[aria-pressed="true"] { background: var(--tone-ink); color: var(--tone-sun); }
.copy section { border: 1px solid var(--kb-edge); border-radius: 16px; background: var(--tone-paper); box-shadow: none; }
.copy h2 { display: block; padding: 0; background: transparent; color: var(--tone-ink); font: 650 22px/1.25 var(--face-plain); letter-spacing: -0.02em; text-transform: none; }
kbd { border: 1px solid var(--kb-edge-2); border-radius: 6px; background: var(--kb-field); }
.bench { background: var(--tone-sun); border-bottom-color: var(--kb-edge); }
@media (max-width: 640px) {
  .top { padding: 32px 16px 16px; }
}
