:root {
  --bg: #f1ece3;
  --paper: #fbf8f3;
  --ink: #141311;
  --ink2: #5e5954;
  --ink3: #8a847c;
  --line: #e5ddd2;
  --line2: #d2c9bc;
  --accent: #e24b2a;
  --bad: #a33b32;
  --good: #1c6b45;
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--bg);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .045;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/></filter><rect width='140' height='140' filter='url(%23n)'/></svg>");
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
::selection { background: rgba(226, 75, 42, .18); }

.bar {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 28px;
  background: rgba(247, 246, 241, .9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.02em; }
.brand .word { display: flex; flex-direction: column; line-height: 1.05; }
.brand b { font-family: var(--serif); font-weight: 500; font-size: 18px; letter-spacing: -.03em; }
.brand .tld { font-family: var(--mono); font-style: normal; font-weight: 500; font-size: 12px; letter-spacing: 0; color: var(--accent); margin-left: 1px; }
.brand small { font-family: var(--mono); font-size: 10px; font-weight: 400; letter-spacing: .12em; text-transform: uppercase; color: var(--ink3); margin-top: 2px; }
.mark { width: 30px; height: 30px; display: block; border-radius: 8px; }
.brand.sm { color: var(--ink2); font-size: 13px; font-weight: 500; font-family: var(--serif); }
.brand.sm .mark { width: 22px; height: 22px; border-radius: 5px; }
.nav { display: flex; gap: 4px; }
.nav a {
  position: relative;
  padding: 6px 10px;
  color: var(--ink2);
  font-size: 13.5px;
  font-weight: 500;
}
.nav a.on { color: var(--ink); }
.nav a.on::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--accent);
}
.bar-r { margin-left: auto; }
.quiet { font-family: var(--mono); font-size: 11px; color: var(--ink3); letter-spacing: .04em; }
.ca-row {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 248, 243, .92);
  font-family: var(--mono);
  font-size: 12px;
}
.ca-row .k { color: var(--accent); letter-spacing: .14em; font-size: 11px; flex: none; }
.ca-row button {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
.ca-row button:hover { color: var(--accent); }
#ca-status { color: var(--ink3); flex: none; }
.ca-row a { color: var(--ink2); flex: none; }
.ca-row a:hover { color: var(--ink); }

main { flex: 1; position: relative; z-index: 1; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 28px 28px 72px; }
.foot {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 16px 28px 22px;
  border-top: 1px solid var(--line);
  color: var(--ink3);
  font-size: 12px;
}
.foot a { margin-left: auto; color: var(--ink2); }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}
h1.serif, .serif {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -.03em;
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 36px;
  align-items: end;
  padding-bottom: 28px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.hero h1 { margin: 8px 0 0; font-size: 52px; line-height: .98; max-width: 12ch; }
.hero p { margin: 14px 0 0; color: var(--ink2); font-size: 15.5px; max-width: 42ch; line-height: 1.55; }
.hero-actions { display: flex; gap: 8px; margin-top: 20px; }
.hero-sheet {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 12px 12px 10px;
  box-shadow: 0 18px 40px rgba(20, 16, 12, .05);
}
.sheet-top, .sheet-cap {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink3);
}
.sheet-top { margin-bottom: 8px; }
.sheet-cap { margin-top: 8px; }
.sec-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink3);
}
.mini {
  position: relative;
  height: 148px;
  border: 1px solid var(--line);
  background:
    linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 25%,
    linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 25% 100%,
    #fdfcf8;
  background-blend-mode: multiply;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}
.mini svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.mini .hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink3);
  font-size: 12px;
  pointer-events: none;
}
.mini .hint.off { opacity: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line2);
  background: var(--paper);
  padding: 10px 14px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink3); }
.btn.pri { background: var(--ink); color: #f7f6f1; border-color: var(--ink); }
.btn.pri:hover { background: #000; }
.btn[disabled] { opacity: .4; cursor: default; }
.btn.block { width: 100%; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  transition: border-color .15s, transform .15s;
}
a.card:hover { border-color: var(--accent); transform: translateY(-1px); }
.card .id { display: flex; align-items: baseline; gap: 8px; }
.card .id b { font-family: var(--serif); font-size: 22px; font-weight: 500; letter-spacing: -.02em; }
.card .id span { font-family: var(--mono); font-size: 11px; color: var(--ink3); }
.card .id em {
  margin-left: auto;
  font-style: normal;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink3);
}
.plate { height: 84px; background: #fdfcf8; border: 1px solid var(--line); padding: 6px 4px 0; }
.plate svg { width: 100%; height: 100%; display: block; }
.meta { display: flex; justify-content: space-between; gap: 8px; font-family: var(--mono); font-size: 11px; color: var(--ink2); }
.meta b { font-weight: 500; color: var(--ink); }
.empty {
  grid-column: 1 / -1;
  padding: 48px 16px;
  text-align: center;
  color: var(--ink3);
}
.empty b { display: block; font-family: var(--serif); font-size: 26px; font-weight: 500; color: var(--ink); margin-bottom: 6px; }

.band {
  position: relative;
  overflow: hidden;
  margin-top: 36px;
  background: #171614;
  color: #f6f1e8;
  padding: 32px 28px 26px;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 28px;
}
.band h2 { font-family: var(--serif); font-weight: 500; font-size: 32px; letter-spacing: -.03em; margin: 8px 0 10px; line-height: 1.05; }
.band p { margin: 0; color: #a7a49c; font-size: 14px; line-height: 1.6; max-width: 52ch; }
.figs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; align-content: end; }
.figs b { display: block; font-family: var(--mono); font-size: 22px; font-weight: 500; color: #f08a72; }
.figs span { display: block; margin-top: 4px; font-size: 12.5px; color: #f3f0e8; }
.figs small { display: block; margin-top: 2px; color: #8d8a83; font-size: 12px; line-height: 1.4; }

.head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-end; margin-bottom: 16px; }
.head h1 { margin: 4px 0 0; font-size: 36px; line-height: 1; }
.head p { margin: 8px 0 0; color: var(--ink2); max-width: 52ch; }

.lab { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.sheet { background: var(--paper); border: 1px solid var(--line); }
.stage { padding: 14px 16px 28px 46px; position: relative; }
.board {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 8.4;
  background:
    linear-gradient(rgba(226, 221, 210, .7) 1px, transparent 1px) 0 0 / 100% 25%,
    linear-gradient(90deg, rgba(226, 221, 210, .7) 1px, transparent 1px) 0 0 / 25% 100%,
    #fdfcf8;
  border: 1px solid var(--line);
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}
.board svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.axis-y, .axis-x { position: absolute; pointer-events: none; font-family: var(--mono); font-size: 10px; color: var(--ink3); letter-spacing: .08em; text-transform: uppercase; }
.axis-y { left: -40px; top: 0; bottom: 0; width: 36px; }
.axis-y span { position: absolute; right: 0; transform: translateY(-50%); }
.axis-x { left: 0; right: 0; bottom: -20px; height: 16px; }
.axis-x span { position: absolute; transform: translateX(-50%); }
.board-hint {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--ink3);
  pointer-events: none;
  transition: opacity .2s;
}
.board-hint b { display: block; font-family: var(--serif); font-weight: 500; font-size: 22px; color: var(--ink); margin-bottom: 4px; }
.board-hint.off { opacity: 0; }
.legend { display: flex; gap: 16px; padding: 8px 16px 12px 46px; font-size: 12px; color: var(--ink3); }
.legend i { display: inline-block; width: 16px; height: 2px; background: var(--ink); margin-right: 6px; vertical-align: middle; }
.legend i.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.side { display: flex; flex-direction: column; gap: 12px; }
.block { background: var(--paper); border: 1px solid var(--line); padding: 14px; }
.block h3 { margin: 0 0 10px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); font-weight: 600; }
.shapes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.shape {
  height: 54px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  color: var(--ink2);
  position: relative;
}
.shape svg { width: 70%; height: 18px; }
.shape em {
  position: absolute;
  left: 0; right: 0; bottom: 4px;
  text-align: center;
  font-style: normal;
  font-size: 10px;
  color: var(--ink3);
}
.shape.on { border-color: var(--ink); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.kv:first-of-type { border-top: 0; }
.kv span { color: var(--ink2); }
.kv b { font-family: var(--mono); font-weight: 500; font-size: 12.5px; }
.kv b.hot { background: #f8e0d4; }
.field { margin-top: 10px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink2); margin-bottom: 5px; }
.field input {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line2);
  padding: 9px 10px;
  outline: none;
}
.field input:focus { border-color: var(--ink); }
.field input[type="file"] { padding: 8px; background: #fff; font-size: 12px; }
.wallet-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.wallet-line span { font-family: var(--mono); font-size: 12px; color: var(--ink2); }
.row2 { display: grid; grid-template-columns: 1fr 110px; gap: 8px; }
.seg { display: flex; background: #e8e4db; padding: 2px; }
.seg button { flex: 1; border: 0; background: none; padding: 6px 4px; font-size: 12px; font-weight: 500; cursor: pointer; color: var(--ink2); }
.seg button.on { background: #fff; color: var(--ink); }
.note { margin: 8px 0 0; font-size: 12px; color: var(--ink3); line-height: 1.45; }
.err { color: var(--bad); font-size: 12.5px; margin-top: 8px; }

.tax {
  position: relative;
  height: 92px;
  border: 1px solid var(--line);
  background: #fff;
  touch-action: none;
  cursor: crosshair;
}
.tax svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tax.off { opacity: .4; filter: grayscale(1); pointer-events: none; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; font-weight: 600; }
.switch button { width: 36px; height: 20px; border-radius: 99px; border: 0; background: #d5d1c8; position: relative; cursor: pointer; }
.switch button i { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch button.on { background: var(--ink); }
.switch button.on i { left: 18px; }

.doc { max-width: 720px; }
.doc h1 { font-size: 44px; margin: 8px 0 8px; line-height: 1.02; }
.doc h2 { font-family: var(--serif); font-weight: 500; font-size: 26px; margin: 32px 0 8px; letter-spacing: -.02em; }
.doc p, .doc li { color: var(--ink2); font-size: 15.5px; line-height: 1.65; }
.doc code { font-family: var(--mono); font-size: 13px; background: #fff; border: 1px solid var(--line); padding: 1px 5px; }
.doc table { width: 100%; border-collapse: collapse; margin: 12px 0 4px; font-size: 14px; }
.doc th, .doc td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.doc th { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); font-weight: 600; }

.detail { display: grid; grid-template-columns: 1fr 320px; gap: 16px; }
.coinhead { display: flex; gap: 16px; align-items: center; padding: 18px; background: var(--paper); border: 1px solid var(--line); }
.monogram {
  width: 72px; height: 72px;
  display: grid; place-items: center;
  background: var(--ink);
  color: #f6f1e8;
  font-family: var(--serif);
  font-size: 30px;
  position: relative;
}
.monogram::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}
.coinhead h1 { margin: 0; font-size: 36px; line-height: 1; }
.coinhead .tk { font-family: var(--mono); color: var(--ink3); margin-top: 4px; }
#qin {
  width: 100%;
  border: 1px solid var(--line2);
  background: #fff;
  font-family: var(--mono);
  font-size: 20px;
  padding: 10px 12px;
  outline: none;
}
#qin:focus { border-color: var(--ink); }
.chips { display: flex; gap: 6px; margin: 8px 0 12px; }
.chips button { flex: 1; border: 1px solid var(--line); background: var(--paper); padding: 6px; cursor: pointer; font-size: 12px; }
.chips button:hover { border-color: var(--ink3); }
.out { font-family: var(--mono); font-size: 13px; line-height: 1.7; }
.out span { color: var(--ink3); }

@media (max-width: 900px) {
  .bar { padding: 0 14px; gap: 12px; }
  .nav a { padding: 6px 7px; }
  .wrap { padding: 18px 14px 48px; }
  .hero, .lab, .detail, .band { grid-template-columns: 1fr; }
  .hero h1 { font-size: 36px; }
  .brand small { display: none; }
  .brand b { font-size: 16px; }
  .brand .tld { font-size: 11px; }
  .quiet { display: none; }
  .ca-row { padding: 8px 14px; gap: 10px; }
  .stage { padding-left: 16px; }
  .legend { padding-left: 16px; }
  .axis-y { display: none; }
}
