:root {
  color: #142033;
  background: #b7c4ce;
  font-family: "Liberation Sans", "Nimbus Sans", sans-serif;
  font-size: 17px;
  line-height: 1.45;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
}

.mast {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  padding: 22px 28px 18px;
  background: #1b3048;
  color: #f4f7f8;
}

.brand {
  margin: 0;
  font-family: "iA Writer Mono", "JetBrains Mono", "Liberation Mono", ui-monospace, monospace;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.where,
.tools,
.hint {
  margin: 4px 0 0;
  color: #c5d3df;
}

.tools { margin: 0; text-align: right; color: #d5e2ec; }

.token-form {
  display: flex;
  gap: 8px;
  align-items: end;
  margin-left: auto;
}

.token-form label { margin: 0; color: #d5e2ec; }
.token-form input { min-width: 180px; }

main {
  width: min(1120px, calc(100% - 32px));
  margin: 22px auto 48px;
  display: grid;
  gap: 16px;
}

.work {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
}

.panel {
  background: #f4f7f8;
  border: 2px solid #1b3048;
  padding: 18px;
}

h1, h2 {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

h2 { font-size: 18px; }

label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 15px;
}

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

input, select, textarea {
  width: 100%;
  border: 1px solid #1b3048;
  background: #fff;
  padding: 9px 10px;
  border-radius: 0;
}

textarea { resize: vertical; }

button {
  border: 2px solid #1b3048;
  background: #1b3048;
  color: #f4f7f8;
  padding: 10px 14px;
  cursor: pointer;
}

button:hover { background: #24415f; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid #0c7ea8;
  outline-offset: 2px;
}

.split, .settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hint { color: #3d5166; font-size: 14px; }

.drop {
  min-height: 160px;
  border: 2px dashed #1b3048;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 16px;
  background: #e7eef2;
  cursor: pointer;
}

.drop input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.drop.hot { background: #d5e7ef; }

#preview {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  margin: 0 0 12px;
  background: #fff;
  border: 1px solid #1b3048;
}

.result[hidden],
#preview[hidden] { display: none; }

.result {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  align-items: center;
  background: #fff;
  border: 2px solid #1b3048;
  padding: 18px;
}

.stamp {
  width: 168px;
  height: 168px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 6px solid currentColor;
  border-radius: 50%;
  font-family: "iA Writer Mono", "JetBrains Mono", "Liberation Mono", ui-monospace, monospace;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.15;
  transform: rotate(-8deg);
}

.stamp.yes { color: #0d6b3e; }
.stamp.no { color: #9d1c1c; }
.stamp.hold { color: #8a5a00; }

.slip-photo {
  display: block;
  max-width: 220px;
  max-height: 140px;
  object-fit: contain;
  margin-bottom: 8px;
  border: 1px solid #1b3048;
  background: #fff;
}

.amount {
  margin: 0;
  font-family: "iA Writer Mono", "JetBrains Mono", "Liberation Mono", ui-monospace, monospace;
  font-size: 52px;
  letter-spacing: -0.05em;
  line-height: 1;
}

.meta, .problems { margin: 8px 0 0; }
.problems { padding-left: 18px; }
.problems li + li { margin-top: 4px; }

.follow {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 12px;
}

.banks, .history-list { list-style: none; padding: 0; margin: 0; }
.banks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.banks li { font-family: "iA Writer Mono", "JetBrains Mono", ui-monospace, monospace; font-size: 14px; }
.up { color: #0d6b3e; }
.down { color: #9d1c1c; }

.history-head, summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

summary { cursor: pointer; font-size: 18px; font-weight: 700; }
summary h2, .history-head h2 { margin: 0; }

.history-list li {
  display: grid;
  grid-template-columns: 148px 1fr auto auto;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid #c5d0d8;
  font-size: 15px;
}

.history-list button.link {
  background: transparent;
  color: #1b3048;
  border: 0;
  padding: 0;
  text-align: left;
}

.check-line {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.settings { margin-top: 14px; }

@media (max-width: 860px) {
  .mast, .work, .result, .split, .settings-grid, .history-list li, .follow {
    display: grid;
    grid-template-columns: 1fr;
  }
  .mast { align-items: start; }
  .tools { text-align: left; }
  .amount { font-size: 40px; }
  main { width: min(100% - 20px, 1120px); }
}
