* {
  box-sizing: border-box;
}
:root {
  font:
    16px/1.5 "Helvetica Neue",
    Arial,
    "PingFang SC",
    sans-serif;
  color: #232321;
  background: #f8f8f5;
  --line: #cdcdc7;
  --muted: #5c5c57;
}
body {
  margin: 0;
}
header {
  padding: 16px 4.8vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  flex-wrap: wrap;
}
.brand {
  font:
    700 24px Georgia,
    serif;
  white-space: nowrap;
}
.brand b {
  font: 900 32px/1 system-ui;
  vertical-align: -2px;
}
.brand i {
  font-weight: 400;
}
nav,
.tools,
.actions,
.keys {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
nav button,
.tools button {
  background: transparent;
  border-color: transparent;
}
nav button[aria-current="true"] {
  background: #242422;
  color: #fff;
}
button,
select,
input {
  font: inherit;
  color: inherit;
  max-width: 100%;
}
button,
select {
  cursor: pointer;
}
button,
select,
input:not([type="checkbox"]) {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.53em 0.74em;
  min-height: 40px;
}
button:hover {
  border-color: #333;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #333;
  outline-offset: 2px;
}
button.primary,
.keys button {
  background: #20201e;
  color: white;
  border-color: #20201e;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
main {
  width: min(1370px, 91%);
  margin: 3.4rem auto 5rem;
}
.intro {
  padding: 0 0 1.6rem;
  border-bottom: 3px solid;
}
.intro h1 {
  font:
    500 clamp(36px, 5vw, 64px) / 1.15 Georgia,
    "Songti SC",
    serif;
  letter-spacing: -0.04em;
  margin: 0 0 0.6rem;
}
.intro p,
.muted,
small,
dt {
  color: var(--muted);
}
p {
  margin: 0.4rem 0 1rem;
}
h2 {
  font:
    500 1.65rem/1.25 Georgia,
    "Songti SC",
    serif;
  margin: 0.3rem 0 1rem;
}
h3 {
  margin: 0.4rem 0;
}
.grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.8fr);
  gap: clamp(20px, 4vw, 64px);
  margin-top: 2rem;
}
.wide-first {
  grid-template-columns: minmax(0, 1.8fr) minmax(215px, 0.8fr);
}
.panel {
  border-top: 1px solid var(--line);
  padding: 1.15rem 0;
  margin-bottom: 1.4rem;
}
.panel:first-child {
  border-top: 0;
  padding-top: 0;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}
.stat {
  padding: 1.3rem 0;
}
.stat b {
  display: block;
  font:
    400 clamp(24px, 3.8vw, 49px) / 1.3 Georgia,
    serif;
}
.stat small {
  font-size: 0.9rem;
}
label {
  display: grid;
  gap: 0.3rem;
  margin-bottom: 0.8rem;
  font-size: 0.93rem;
}
input,
select {
  width: 100%;
  min-width: 0;
}
.tools select,
input[type="checkbox"] {
  width: auto;
}
.check {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}
.actions {
  margin: 0.8rem 0;
}
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.row strong {
  min-width: 0;
}
.row .actions {
  margin: 0;
}
.record {
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}
dt {
  font-size: 0.82rem;
}
dd {
  margin: 0;
  overflow-wrap: anywhere;
}
dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.8rem;
  margin: 0.7rem 0;
}
.proof,
.screen {
  aspect-ratio: 5/3;
  width: 100%;
  border: 1px solid #bcbcb6;
  background: white;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
}
.proof img,
canvas {
  width: 100%;
  height: auto;
  display: block;
  image-rendering: pixelated;
}
.proof small {
  padding: 12px;
}
.enclosure {
  background: #deded9;
  border: 1px solid #b8b8b0;
  border-radius: 18px;
  padding: clamp(13px, 2.7vw, 34px);
  box-shadow: inset 0 0 0 3px #eaeae7;
}
.screen {
  border: 6px solid #30302e;
  box-sizing: content-box;
  width: calc(100% - 12px);
}
.keys {
  justify-content: flex-end;
  margin-top: 1rem;
}
.keys button {
  font-size: 0.85rem;
  min-height: 32px;
}
.login {
  max-width: 470px;
  margin: 7vh auto;
}
.login h1 {
  font:
    500 2.7rem Georgia,
    "Songti SC",
    serif;
}
dialog {
  max-width: min(95%, 560px);
  border: 1px solid #aaa;
  border-radius: 5px;
  padding: 1.6rem;
}
dialog::backdrop {
  background: #0005;
}
code {
  overflow-wrap: anywhere;
}
#notice:not(:empty) {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: #222;
  color: white;
  padding: 0.7rem 1.2rem;
  border-radius: 3px;
  max-width: 90vw;
  z-index: 3;
}
.file {
  position: relative;
  display: block;
  cursor: pointer;
}
.file input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.file span {
  display: block;
  border: 1px solid var(--line);
  padding: 0.6rem;
  background: white;
}
.file:focus-within {
  outline: 2px solid;
}
.chip {
  font-size: 0.82rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 20px;
}
.uuid {
  font: 0.8rem monospace;
  word-break: break-all;
}
.login button {
  width: 100%;
}
[hidden] {
  display: none !important;
}
@media (max-width: 760px) {
  header {
    gap: 10px;
    padding: 12px 4%;
  }
  nav {
    order: 3;
    width: 100%;
    gap: 3px;
  }
  nav button {
    font-size: 0.86rem;
    padding: 0.45em 0.6em;
  }
  .brand {
    font-size: 22px;
  }
  .tools {
    gap: 3px;
  }
  .tools button,
  .tools select {
    font-size: 0.86rem;
  }
  .grid,
  .wide-first {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  main {
    margin: 2rem auto;
  }
  .fields {
    gap: 0.6rem;
  }
  .intro h1 {
    font-size: 38px;
  }
  .stats {
    gap: 12px;
  }
  .stat small {
    font-size: 0.8rem;
  }
  .row {
    flex-wrap: wrap;
  }
}

input[type="checkbox"] {
  accent-color: #242422;
}
