/* VatMarket — light floor.
   Palette structure follows fee-market.com, with the green family remapped to
   a light-orange one. Sharp 3px corners, hairline rules, mono for numbers. */

:root {
  --bg:          #fdf9f4;
  --surface:     #ffffff;
  --surface-2:   #f9efe3;
  --line:        #ecdcc6;
  --line-soft:   #f5e9da;

  --ink:         #1a1512;
  --ink-2:       #6b5c4c;
  --ink-3:       #9a8b79;

  --accent:      #f2913c;   /* light orange — fills, bars, marks */
  --accent-2:    #d1700f;   /* hover / emphasis */
  --accent-ink:  #9a5407;   /* accent as text on light — keeps contrast */
  --accent-wash: #fdeeda;

  --neg:         #c0492f;
  --pos:         #7a8b3f;

  --sans: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --mono: "DM Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --radius: 3px;
  --maxw: 1060px;
  --pad: 17px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .num { font-family: var(--mono); }
em { font-style: normal; color: var(--accent-ink); font-weight: 500; }

::selection { background: var(--accent-wash); }

/* ── header ─────────────────────────────────────────── */

.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(253, 249, 244, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.top-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 12px 20px;
  display: flex; align-items: center; gap: 20px;
}

.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-tile {
  width: 28px; height: 28px; border-radius: var(--radius);
  background: var(--ink); color: var(--accent);
  display: grid; place-items: center;
}
.brand-tile svg { width: 20px; height: 20px; }
.brand-word { font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.brand-dot { color: var(--ink-3); font-weight: 400; }

.nav { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.nav a {
  color: var(--ink-2); font-size: 13.5px; padding: 5px 10px;
  border-radius: var(--radius); border: 1px solid transparent;
}
.nav a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.nav a.on {
  color: var(--accent-ink); background: var(--accent-wash);
  border-color: var(--line); font-weight: 500;
}

.actions { display: flex; gap: 8px; }

.btn {
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  padding: 7px 14px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; transition: background .14s, border-color .14s, color .14s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); background: var(--surface-2); text-decoration: none; }
/* Soft warm fill, the same family as the vote strip. Text uses --accent-ink
   rather than --accent: the light orange as type on a light wash would not
   carry enough contrast. */
.btn-solid {
  background: var(--accent-wash); color: var(--accent-ink); border-color: var(--accent);
}
.btn-solid:hover { background: var(--accent); color: var(--ink); border-color: var(--accent); }
.btn-ghost { color: var(--ink-2); }
.btn-lg { font-size: 14.5px; padding: 11px 22px; }

/* token bar (opens under the header) */
.token-bar {
  border-top: 1px solid var(--line-soft); background: var(--surface-2);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  max-width: var(--maxw); margin: 0 auto; padding: 9px 20px;
  font-family: var(--mono); font-size: 12.5px;
}
.tb-k { color: var(--ink-3); }
#tb-ca { color: var(--ink); }
.tb-copy, .tb-buy {
  font-family: var(--sans); font-size: 12px; padding: 3px 9px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.tb-copy:hover, .tb-buy:hover { border-color: var(--accent); color: var(--accent-ink); text-decoration: none; }

/* ── layout ─────────────────────────────────────────── */

main { max-width: var(--maxw); margin: 0 auto; padding: 0 20px 72px; }
.page { padding-top: 42px; }

.page-head { text-align: center; margin-bottom: 26px; }
h1, h2, h3 { letter-spacing: -.02em; font-weight: 700; }
h2 { font-size: 26px; margin-bottom: 10px; }
h3 { font-size: 14.5px; margin-bottom: 6px; font-weight: 500; }
.lead { color: var(--ink-2); max-width: 620px; margin: 0 auto; }
.fine { color: var(--ink-3); font-size: 12.5px; line-height: 1.55; }
.center { text-align: center; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--pad);
}

/* ── hero ───────────────────────────────────────────── */

.hero { text-align: center; padding: 34px 0 30px; }
.eyebrow {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .09em;
  text-transform: uppercase; color: var(--accent-ink);
  background: var(--accent-wash); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 4px 11px; display: inline-block;
  margin-bottom: 20px;
}
.display {
  font-size: clamp(30px, 6.2vw, 54px); line-height: 1.06;
  letter-spacing: -.035em; margin-bottom: 16px;
}
.hero-sub {
  color: var(--ink-2); font-size: 15px; max-width: 480px;
  margin: 0 auto 26px; line-height: 1.58;
}
.hero-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ── the lying bar ──────────────────────────────────── */

.bar-card { max-width: 620px; margin: 0 auto; }
.bar-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.bar-label { font-size: 13px; color: var(--ink-2); }
.bar-pct { font-family: var(--mono); font-size: 15px; color: var(--accent-ink); }
.bar-track {
  height: 12px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.bar-fill {
  height: 100%; width: 0%; background: var(--accent);
  transition: width .5s steps(7);
}
.bar-card .fine { margin-top: 10px; }

/* ── stats ──────────────────────────────────────────── */

.stats {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; margin-top: 22px;
}
.stat { background: var(--surface); padding: 12px 14px; text-align: center; }
.stat-k { display: block; color: var(--ink-3); font-size: 11px; margin-bottom: 2px; }
.stat-v { display: block; font-family: var(--mono); font-size: 15px; color: var(--ink); }



/* ── floor ──────────────────────────────────────────── */

.floor-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.floor-table th {
  text-align: left; font-weight: 500; color: var(--ink-3); font-size: 11.5px;
  padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.floor-table td {
  padding: 10px 14px; border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2); white-space: nowrap;
}
.floor-table th.num, .floor-table td.num { text-align: right; font-family: var(--mono); }
.floor-table tr:last-child td { border-bottom: none; }
.floor-table tr:hover td { background: var(--surface-2); }
.mono-dim { font-family: var(--mono); color: var(--ink-3); }
.mult { color: var(--ink-3); font-family: var(--mono); font-size: 11px; margin-left: 6px; }
.floor-table td.acc { color: var(--pos); }

.str-cell { display: flex; align-items: center; gap: 8px; }
.str-track {
  display: inline-block; width: 76px; height: 7px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.str-fill { display: block; height: 100%; background: var(--accent); }
.str-pct { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); min-width: 30px; }

.pill {
  display: inline-block; font-size: 11px; padding: 2px 8px;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink-2);
}
.st-building { color: var(--accent-ink); background: var(--accent-wash); }
.st-full { color: #fff; background: var(--accent-2); border-color: var(--accent-2); }
.st-fading { color: var(--ink-2); }
.st-flat { color: var(--neg); }

/* ── tap ────────────────────────────────────────────── */

.vote-bar {
  max-width: 720px; margin: 0 auto 14px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 14px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface-2);
  font-size: 13px; color: var(--ink-2);
}
.vote-you b { font-family: var(--mono); color: var(--ink); font-weight: 500; }
.vote-state {
  font-size: 12px; color: var(--ink-3); font-family: var(--mono);
  padding: 3px 10px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface);
}
.vote-state.on {
  color: var(--accent-ink); background: var(--accent-wash); border-color: var(--accent);
}

.route-grid {
  max-width: 720px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px;
}
.route-card {
  display: flex; flex-direction: column; gap: 7px; text-align: left;
  font-family: var(--sans); font-size: 13.5px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--pad); cursor: pointer;
  transition: border-color .14s, background .14s, box-shadow .14s;
}
.route-card:hover { border-color: var(--accent); background: var(--surface-2); }
.route-card.voted {
  border-color: var(--accent); background: var(--accent-wash);
  box-shadow: inset 3px 0 0 var(--accent);
}
.route-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.route-name { font-size: 14.5px; font-weight: 500; color: var(--ink); }
.route-share { font-family: var(--mono); font-size: 15px; color: var(--accent-ink); }
.route-desc { color: var(--ink-2); font-size: 12.5px; line-height: 1.5; }
.route-track {
  height: 8px; background: var(--surface-2); margin-top: 2px;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.route-card.voted .route-track { background: var(--surface); }
.route-fill { display: block; height: 100%; background: var(--accent); transition: width .5s; }
.route-foot { font-size: 11.5px; color: var(--ink-3); font-family: var(--mono); }
.route-card.voted .route-foot { color: var(--accent-ink); }

.note-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px; margin-top: 22px;
}
.note {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--pad);
}
.note p { color: var(--ink-2); font-size: 13.5px; }




/* ── log ────────────────────────────────────────────── */

.table-wrap { padding: 0; overflow-x: auto; }
.log-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.log-table th {
  text-align: left; font-weight: 500; color: var(--ink-3); font-size: 11.5px;
  padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.log-table td {
  padding: 10px 14px; border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono); color: var(--ink-2); white-space: nowrap;
}
.log-table th.num, .log-table td.num { text-align: right; }
.log-table td:first-child { color: var(--accent-ink); }
.log-table tr:last-child td { border-bottom: none; }
.log-table tr.fresh td { animation: pour-in .9s ease-out; }
@keyframes pour-in { from { background: var(--accent-wash); } to { background: transparent; } }

/* ── footer / toast ─────────────────────────────────── */

.bottom { border-top: 1px solid var(--line); }
.bottom-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 18px 20px 28px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  color: var(--ink-3); font-size: 12px;
}
.links a { color: var(--ink-3); }
.links a:hover { color: var(--accent-ink); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 13px;
  padding: 9px 16px; border-radius: var(--radius); z-index: 50;
  animation: toast-in .18s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ── responsive ─────────────────────────────────────── */

@media (max-width: 860px) {
  .top-inner { flex-wrap: wrap; gap: 10px; }
  .nav { order: 3; width: 100%; margin-left: 0; justify-content: center; }
  .actions { margin-left: auto; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .route { grid-template-columns: 92px 1fr 40px; }
  .bottom-inner { flex-direction: column; align-items: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bar-fill, .route-fill { transition: none; }
  .log-table tr.fresh td, .toast { animation: none; }
}

/* ── steps / how it works ───────────────────────────── */

.step-n {
  font-family: var(--mono); font-size: 11.5px; color: var(--accent-ink);
  display: block; margin-bottom: 8px;
}
.section-head { text-align: center; margin: 40px 0 18px; }
.section-head h2 { font-size: 21px; }

.how-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 12px; }
.how-step p { color: var(--ink-2); font-size: 13.5px; }
.how-step p + p { margin-top: 8px; }
.how-step b { color: var(--ink); font-weight: 500; }

.wide-note { max-width: 720px; margin: 0 auto; }
.wide-note p { color: var(--ink-2); font-size: 13.5px; }
.wide-note p + p { margin-top: 10px; }

.bar-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 10px; }
.vat-amount { font-family: var(--mono); font-size: 13px; color: var(--accent-ink); white-space: nowrap; }
.chip {
  font-family: var(--mono); font-size: 11px; color: var(--accent-ink);
  background: var(--accent-wash); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1px 6px; margin-left: 6px;
}

.route-card.static { cursor: default; }
.route-card.static:hover { border-color: var(--line); background: var(--surface); }
.route-grid.static { max-width: 100%; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }


/* ── create ─────────────────────────────────────────── */

.create-wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.create-form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field-k { font-size: 12px; color: var(--ink-3); font-family: var(--mono); }
.field input {
  font-family: var(--sans); font-size: 14px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 9px 11px; width: 100%;
}
.field input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.field-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 8px 0; border-top: 1px solid var(--line-soft);
}
.field-fixed { font-family: var(--mono); font-size: 12.5px; color: var(--accent-ink); }
.create-side { display: flex; flex-direction: column; gap: 12px; }
.create-side .note p { color: var(--ink-2); font-size: 13px; }

@media (max-width: 780px) { .create-wrap { grid-template-columns: minmax(0, 1fr); } }

/* ── vats: card grid ────────────────────────────────── */

.vat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 14px;
}
.vat-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 18px 14px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color .14s, box-shadow .14s;
}
.vat-card:hover { border-color: var(--accent); box-shadow: 0 1px 0 var(--line); }

.vc-head { display: flex; align-items: center; gap: 11px; }
.vc-pic {
  width: 40px; height: 40px; border-radius: var(--radius);
  border: 1px solid var(--line); object-fit: cover; flex: none; background: var(--surface-2);
}
.vc-id { display: flex; flex-direction: column; min-width: 0; }
.vc-sym { font-family: var(--mono); font-size: 14px; color: var(--ink); }
.vc-name {
  font-size: 12px; color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vc-soon {
  margin-left: auto; font-family: var(--mono); font-size: 11.5px;
  color: var(--accent-ink); background: var(--accent-wash);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 2px 8px; white-space: nowrap;
}

.vc-amount { display: flex; align-items: baseline; gap: 7px; }
.vc-eth {
  font-family: var(--mono); font-size: 27px; color: var(--ink);
  letter-spacing: -.02em; line-height: 1;
}
.vc-unit { font-size: 11.5px; color: var(--ink-3); }

.vc-track {
  height: 6px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
}
.vc-fill { display: block; height: 100%; background: var(--accent); transition: width .6s; }

.vc-lead { display: flex; align-items: center; gap: 9px; }
.vc-k { font-size: 11.5px; color: var(--ink-3); font-family: var(--mono); }

.vc-foot {
  display: flex; justify-content: space-between; gap: 10px;
  padding-top: 11px; border-top: 1px solid var(--line-soft);
  font-size: 11.5px; color: var(--ink-3);
}
.vc-foot b { font-family: var(--mono); font-weight: 400; color: var(--ink-2); }

/* ── create: image, snipe, auto link ─────────────────── */

.pic-row { display: flex; gap: 14px; align-items: flex-start; }
.pic-drop {
  width: 92px; height: 92px; flex: none; cursor: pointer;
  border: 1px dashed var(--line); border-radius: var(--radius);
  background: var(--surface-2); display: grid; place-items: center;
  overflow: hidden; transition: border-color .14s, background .14s;
}
.pic-drop:hover { border-color: var(--accent); background: var(--accent-wash); }
.pic-drop img { width: 100%; height: 100%; object-fit: cover; }
.pic-hint {
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
  text-align: center; line-height: 1.35;
}
.pic-side { display: flex; flex-direction: column; gap: 5px; padding-top: 2px; }
.pic-clear { align-self: flex-start; font-size: 12px; padding: 4px 10px; margin-top: 2px; }

.eth-input { position: relative; display: flex; align-items: center; }
.eth-input input { padding-right: 46px; }
.eth-suffix {
  position: absolute; right: 11px; font-family: var(--mono);
  font-size: 12.5px; color: var(--ink-3); pointer-events: none;
}

.auto-field {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 9px 11px;
}
.auto-field code { font-size: 13px; color: var(--accent-ink); background: none; padding: 0; }
.auto-tag {
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .06em; white-space: nowrap;
}

@media (max-width: 560px) {
  .vat-grid { grid-template-columns: minmax(0, 1fr); }
  .vc-foot { flex-wrap: wrap; }
}

/* ── the opening: announcement + flash ──────────────── */

.open-banner {
  max-width: 620px; margin: 0 auto 12px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface);
  transition: border-color .3s, background .3s;
}
/* a fresh opening lights the panel up briefly, then it settles into a record */
.open-banner.fresh {
  border-color: var(--accent); background: var(--accent-wash);
  animation: ob-in .35s cubic-bezier(.2, .8, .3, 1);
}

.ob-mark {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-2); background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius); padding: 3px 9px; white-space: nowrap;
}
.ob-body { font-size: 13.5px; color: var(--ink-2); }
.ob-body b { font-family: var(--mono); font-weight: 500; color: var(--ink); }
.ob-next {
  margin-left: auto; font-size: 12px; color: var(--accent-ink);
  display: flex; align-items: center; gap: 7px; white-space: nowrap;
}
.ob-next::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); animation: ob-pulse 1.6s ease-in-out infinite;
}

@keyframes ob-in { from { opacity: 0; transform: translateY(-8px); } }
.open-banner.fresh .ob-mark { color: #fff; background: var(--accent-2); border-color: var(--accent-2); }
@keyframes ob-pulse { 50% { opacity: .25; } }

/* the bar itself reacts when the vat empties */
.bar-card.opening { border-color: var(--accent); }
.bar-card.opening .bar-fill { background: var(--accent-2); animation: bar-flash .5s ease-out 2; }
@keyframes bar-flash { 50% { opacity: .35; } }

.btn-notify {
  font-family: var(--sans); font-size: 11.5px; color: var(--ink-3);
  background: none; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 3px 9px; cursor: pointer;
  transition: color .14s, border-color .14s;
}
.btn-notify:hover { color: var(--accent-ink); border-color: var(--accent); }
.btn-notify.on { color: var(--accent-ink); background: var(--accent-wash); border-color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .open-banner.fresh { animation: none; }
  .ob-next::before, .bar-card.opening .bar-fill { animation: none; }
}

/* ── empty states ───────────────────────────────────── */

.empty {
  max-width: 520px; margin: 0 auto; text-align: center;
  border: 1px dashed var(--line); border-radius: var(--radius);
  background: var(--surface); padding: 40px 24px;
}
.empty-t { font-size: 16px; font-weight: 500; color: var(--ink); margin-bottom: 8px; }
.empty .fine { max-width: 380px; margin: 0 auto; }
.empty .btn { margin-top: 18px; }
