:root {
  color-scheme: light;
  --ink: #293f38;
  --faint: #58685e;
  --paper: #fffcf1;
  --line: #c9c7ac;
  --vermilion: #9c4934;
  font-family: "Source Sans 3", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
  background-color: #edeadd;
  background-image: repeating-linear-gradient(45deg, transparent 0 5px, #57553c05 5px 6px);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
main { max-width: 846px; margin: clamp(20px, 7vh, 76px) auto; padding: 0 18px; }
.mast { display: flex; gap: 17px; align-items: center; margin-bottom: 26px; }
.folio { color: var(--vermilion); font-size: 13px; letter-spacing: .14em; margin: 0 0 5px; }
h1, h2, .postmark, .lanes dd { font-family: "Noto Serif CJK SC", "Songti SC", SimSun, serif; }
h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.2; letter-spacing: .05em; margin: 0; }
h2 { font-size: 18px; margin: 0; letter-spacing: .08em; }
.postmark { display: grid; place-items: center; width: 50px; height: 60px; border: 3px double var(--vermilion); border-radius: 22px 22px 5px 5px; color: var(--vermilion); font-size: 27px; transform: rotate(-7deg); }
.desk { display: grid; grid-template-columns: minmax(0, 558px) minmax(170px, 1fr); gap: 16px; align-items: stretch; }
.sheet, .kit { background-color: var(--paper); border: 1px solid var(--line); box-shadow: 0 3px 0 #c0bea544; }
.sheet { padding: 14px 18px 0; }
.sheet-head, .kit-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sheet-head { margin-bottom: 12px; }
#phase, .ink { color: var(--faint); font-size: 13px; }
canvas { display: block; width: 100%; height: auto; background: #c6d9cc; touch-action: none; cursor: crosshair; outline: 1px solid #789384; }
button:focus-visible, canvas:focus-visible { outline: 3px solid #a05622; outline-offset: 2px; }
.legend, .lanes, .legend span { display: flex; align-items: center; }
.legend { flex-wrap: wrap; gap: 8px 16px; padding: 10px 0; font-size: 12px; color: var(--faint); }
.legend span { gap: 6px; }
.sample { display: inline-block; width: 16px; height: 12px; }
.sample.route { height: 0; border-top: 2px dashed var(--vermilion); }
.sample.rough { border: 1px dashed #805b3f; }
.sample.set { border: 2px solid #384d37; background: radial-gradient(ellipse at center,#384d37 1px,transparent 3px); }
.lanes { margin: 0; border-top: 1px solid var(--line); gap: 28px; padding: 9px 0; }
.lanes div { display: flex; align-items: baseline; gap: 9px; }
.lanes dt { font-size: 12px; color: var(--faint); }
.lanes dd { margin: 0; font-size: 14px; }
.lanes b { font-size: 20px; font-variant-numeric: tabular-nums; }
.kit { padding: 16px; display: flex; flex-direction: column; }
.ink strong { color: var(--vermilion); font-size: 18px; }
.tools { display: grid; gap: 7px; margin-top: 16px; }
button { cursor: pointer; font: inherit; color: var(--ink); }
.tools button { display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); background: transparent; padding: 8px 12px; font-size: 14px; border-radius: 3px; }
.tools button span { font-family: serif; font-size: 17px; width: 16px; text-align: center; }
.tools button[aria-pressed="true"] { border-color: #455f50; box-shadow: inset 3px 0 #455f50; background: #e4ebdb; }
.tools button:hover { border-color: #455f50; }
button:disabled { opacity: .52; cursor: default; }
.hint, .note { line-height: 1.6; color: var(--faint); font-size: 13px; }
.dispatch { margin-top: auto; }
#estimate { font-size: 14px; margin: 12px 0 8px; }
#action { width: 100%; min-height: 42px; padding: 5px; border: 1px solid #294335; border-radius: 3px; color: #fffced; background: #344f41; }
#action:hover { background: #274034; }
.note { border-left: 3px solid var(--vermilion); padding-left: 10px; min-height: 21px; }
@media (max-width: 710px) {
  main { max-width: 594px; margin: 22px auto; }
  .mast { margin-bottom: 15px; }
  .desk { grid-template-columns: 1fr; gap: 10px; }
  .sheet, .kit { padding: 12px; }
  .sheet { padding-bottom: 0; }
  .tools { grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 8px; }
  .tools button { justify-content: center; gap: 4px; padding: 6px 2px; }
  .dispatch { display: flex; align-items: center; gap: 15px; }
  #action { width: auto; min-width: 100px; padding: 5px 10px; margin-left: auto; }
  .hint { margin: 8px 0; }
}

.papers { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.papers span { color: var(--ink); border-bottom: 2px solid var(--vermilion); padding: 4px 0; }
.papers a { color: var(--faint); padding: 4px 0; text-underline-offset: .25em; }
.sample.step { border-top: 3px solid #2f5550; height: 0; }
#new-paper { margin-top: 8px; }
@media (max-width: 550px) {
  .mast { flex-wrap: wrap; }
  .papers { width: 100%; margin: 0; }
}

.post #offers { display: grid; gap: 8px; }
.post #offers button { border: 1px solid var(--line); border-left: 3px solid #916348; background: #faf3df; text-align: left; padding: 10px; line-height: 1.6; }
.post .minor { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 12px 0; color: var(--faint); font-size: 13px; }
.post .minor button { padding: 3px 0; border: none; border-bottom: 1px solid var(--line); background: transparent; }
.post .receipt { border: 1px solid var(--line); padding: 14px 18px; background: #fbf6e7; }
.post .receipt ul { margin: 0; padding-left: 20px; }
.post .tools { grid-template-columns: repeat(2, 1fr); }
.post .tools button { justify-content: center; }
.post #letter { margin: 12px 0; }
.post #cell-info { min-height: 1.6em; border-top: 1px solid var(--line); padding-top: 8px; }
.post [hidden] { display: none !important; }
