/* L3ND: the sheet. A dark spreadsheet app in the logo palette. */
@font-face { font-family: 'Geist Mono'; src: url('/assets/fonts/geist-mono-var.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('/assets/fonts/geist.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --cell: #0b0b0c;
  --raise: #151516;
  --raise2: #1c1c1e;
  --grid: #232324;
  --gutter: #111112;
  --dim: #8a8a84;
  --ink: #ede6d6;
  --lime: #c6f432;
  --lime-dim: #9fbf2a;
  --warn: #ff6b4a;
  --row: 28px;
  --gut: 44px;
  --narrow: clamp(12px, 1.6vw, 28px);
  --mono: 'Geist Mono', ui-monospace, monospace;
  --sans: 'Geist', system-ui, sans-serif;
  --cols: var(--gut) repeat(8, var(--narrow)) repeat(6, minmax(0, 1fr));
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--cell); color: var(--ink); }
html, body { overflow-x: clip; }
body { font: 13px/1.45 var(--sans); min-height: 100vh; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 1px; }
::selection { background: var(--lime); color: var(--cell); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- chrome ---------- */
.chrome { position: sticky; top: 0; z-index: 30; background: var(--cell); }
.title { display: flex; align-items: center; gap: 12px; padding: 10px 14px 0; }
.title .mark { width: 34px; height: 34px; border-radius: 50%; display: block; flex: none; }
.title .docname { min-width: 0; }
.title h1 { margin: 0; font: 500 17px/1.2 var(--sans); letter-spacing: -0.01em; display: flex; align-items: baseline; gap: 10px; }
.title .sync { font-size: 12px; color: var(--dim); white-space: nowrap; }
.title .sync b { color: var(--ink); font-weight: 500; }
.menu { display: flex; gap: 2px; margin: 2px 0 0 -6px; flex-wrap: wrap; }
.menu a { text-decoration: none; padding: 2px 6px; border-radius: 4px; font-size: 13px; color: #cfc8b8; }
.menu a:hover, .menu a[aria-current] { background: var(--raise2); color: var(--ink); }
.right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ico { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--raise); color: var(--ink); text-decoration: none; transition: background .2s; }
.ico:hover { background: var(--raise2); }
.ca { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 17px; background: var(--raise); border: 0; font: 12px var(--mono); cursor: pointer; }
.ca:hover { background: var(--raise2); }
.pill { height: 34px; padding: 0 16px; border-radius: 17px; border: 0; display: inline-flex; align-items: center; gap: 8px; font: 500 13px var(--sans); cursor: pointer; text-decoration: none; white-space: nowrap; }
.pill.lime { background: var(--lime); color: var(--cell); }
.pill.lime:hover { background: #d4ff4a; }
.pill.ghost { background: var(--raise); color: var(--ink); }
.pill.ghost:hover { background: var(--raise2); }
.pill:disabled { opacity: .45; cursor: not-allowed; }

.tools { margin: 8px 10px 0; height: 36px; border-radius: 18px; background: var(--raise); display: flex; align-items: center; gap: 4px; padding: 0 8px; overflow-x: auto; scrollbar-width: none; }
.tools::-webkit-scrollbar { display: none; }
.tools .t { height: 26px; padding: 0 10px; border-radius: 6px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: #cfc8b8; font-size: 12.5px; }
.tools .t b { color: var(--ink); font-weight: 600; }
.tools .sep { width: 1px; height: 18px; background: #2c2c2e; margin: 0 4px; flex: none; }
.tools .t.on { color: var(--lime); }

.fx { display: grid; grid-template-columns: 88px 30px 1fr; align-items: center; height: 30px; margin-top: 6px; border-top: 1px solid var(--grid); border-bottom: 1px solid var(--grid); font: 12px var(--mono); }
.fx .ref { padding: 0 10px; border-right: 1px solid var(--grid); height: 100%; display: flex; align-items: center; }
.fx .f { color: var(--dim); font-style: italic; text-align: center; font-family: var(--sans); }
.fx .val { padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 1px solid var(--grid); height: 100%; display: flex; align-items: center; }
.fx .val.live { color: var(--lime); }

/* column letters */
.colhead { display: grid; grid-template-columns: var(--cols); height: 22px; background: var(--gutter); border-bottom: 1px solid var(--grid); font: 11px var(--mono); color: var(--dim); }
.colhead span { display: grid; place-items: center; border-right: 1px solid var(--grid); transition: background .15s, color .15s; }
.colhead span.hot { background: #22261a; color: var(--lime); }

/* ---------- the sheet ---------- */
.sheet { position: relative; padding-bottom: 60px; min-height: calc(100vh - 180px);
  background-image: linear-gradient(to bottom, var(--grid) 1px, transparent 1px); background-size: 100% var(--row); }
.lines { position: absolute; inset: 0; display: grid; grid-template-columns: var(--cols); pointer-events: none; z-index: 0; }
.lines i { border-right: 1px solid var(--grid); }
.lines i:first-child { background: var(--gutter); }
.lines i.band { background: rgba(255, 255, 255, .012); }
.rownums { position: absolute; left: 0; top: 0; width: var(--gut); z-index: 2; font: 11px var(--mono); color: var(--dim); }
.rownums span { display: block; height: var(--row); line-height: var(--row); text-align: center; transition: color .15s, background .15s; }
.rownums span.hot { color: var(--lime); background: #22261a; }

.page { position: relative; z-index: 1; display: none; }
.page.on { display: block; }
.r { display: grid; grid-template-columns: var(--cols); }
.c { min-width: 0; }

/* placement helpers on the 15-col template (1 = gutter) */
.span-logo { grid-column: 2 / 10; }
.span-all { grid-column: 2 / -1; }
.span-wide { grid-column: 10 / -1; }
.span-a { grid-column: 10 / 12; }
.span-b { grid-column: 12 / 14; }
.span-c { grid-column: 14 / 16; }
.span-ab { grid-column: 10 / 14; }
.span-bc { grid-column: 12 / -1; }

/* rows are multiples of the row height */
.h1 { min-height: var(--row); } .h2 { min-height: calc(var(--row) * 2); } .h3 { min-height: calc(var(--row) * 3); }
.h4 { min-height: calc(var(--row) * 4); } .h8 { min-height: calc(var(--row) * 8); }

/* ---------- home ---------- */
.pix { display: block; width: 100%; aspect-ratio: 1; image-rendering: pixelated; background: var(--cell); }
.logo-cell { padding: var(--row) 0 0; }
.pitch { padding: calc(var(--row) * 1) 14px 0; }
.pitch p { margin: 0; font: 400 clamp(17px, 1.75vw, 30px)/calc(var(--row) * 1.5) var(--mono); letter-spacing: -0.02em; max-width: 34ch; text-wrap: balance; }
.pitch p em { font-style: normal; color: var(--lime); }
.pitch .sub { margin-top: calc(var(--row) * .5); font: 13px/var(--row) var(--sans); color: #cfc8b8; max-width: 62ch; }
.cta { display: flex; gap: 10px; padding: var(--row) 14px 0; flex-wrap: wrap; }

.wave { padding: 0 14px; font: 600 12px/var(--row) var(--mono); }
.wave span { display: block; height: var(--row); white-space: nowrap; opacity: .18; animation: breathe 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * -0.16s); }
@keyframes breathe { 0%, 100% { opacity: .14; } 50% { opacity: 1; } }

.big { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--grid); }
.big a { display: block; padding: 8px 14px 10px; text-decoration: none; font: 400 clamp(18px, 2vw, 30px)/1.3 var(--sans); letter-spacing: -0.02em; border-right: 1px solid var(--grid); border-bottom: 1px solid var(--grid); position: relative; transition: color .2s, background .2s; min-height: calc(var(--row) * 3); }
.big a small { display: block; font: 12px/1.4 var(--sans); color: var(--dim); margin-top: 4px; max-width: 34ch; }
.big a:hover { background: #121410; color: var(--lime); }
.big a:hover::after { content: ''; position: absolute; inset: -1px; border: 2px solid var(--lime); pointer-events: none; }
.big a:hover::before { content: ''; position: absolute; right: -4px; bottom: -4px; width: 7px; height: 7px; background: var(--lime); z-index: 2; }

.paper { background: var(--ink); color: var(--cell); padding: 14px 16px 16px; transform: rotate(-2.2deg); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); margin: calc(var(--row) * .5) 14px; max-width: 360px; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.paper:hover { transform: rotate(-.6deg) translateY(-3px); }
.paper h3 { margin: 0 0 6px; font: 650 15px var(--sans); }
.paper ul { margin: 0; padding: 0; list-style: none; font: 12px/1.6 var(--mono); }
.paper li { padding: 3px 0; border-top: 1px solid #cfc7b5; }
.paper li:first-child { border-top: 0; }

/* ledger strip: rows of cells */
.ledger { font: 12px var(--mono); }
.ledger .lr { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr 1fr .9fr; min-height: var(--row); align-items: center; border-bottom: 1px solid var(--grid); }
.ledger .lr > * { padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ledger .lr.head { color: var(--dim); font-family: var(--sans); }
.ledger a.lr { text-decoration: none; transition: background .15s; }
.ledger a.lr:hover { background: #121410; }
.empty { padding: 0 14px; font: 12px/var(--row) var(--mono); color: var(--dim); }
.st { display: inline-block; padding: 0 6px; border-radius: 3px; line-height: 18px; }
.st.repaid, .st.ok { background: var(--lime); color: var(--cell); }
.st.open { background: var(--raise2); }
.st.partly { background: #2d3517; color: var(--lime); }
.st.overdue, .st.fail { background: #3a1a12; color: var(--warn); }

.sec { padding: 0 14px; font: 600 14px/var(--row) var(--sans); color: var(--lime); }
.note { padding: 0 14px; font: 12px/var(--row) var(--sans); color: var(--dim); }

/* ---------- tool sheets ---------- */
.form { display: grid; grid-template-columns: minmax(130px, 200px) minmax(0, 1fr); border-top: 1px solid var(--grid); }
.form > label, .form > .lab { padding: 0 10px; font: 12px/var(--row) var(--sans); color: #cfc8b8; border-bottom: 1px solid var(--grid); border-right: 1px solid var(--grid); background: var(--gutter); min-height: var(--row); }
.form > .in { border-bottom: 1px solid var(--grid); min-height: var(--row); position: relative; display: flex; align-items: stretch; }
.form input, .form select, .form textarea { width: 100%; border: 0; background: transparent; padding: 0 10px; font: 13px/var(--row) var(--mono); height: var(--row); outline: 0; }
.form textarea { height: auto; min-height: calc(var(--row) * 6); line-height: var(--row); resize: vertical; background-image: linear-gradient(to bottom, transparent calc(var(--row) - 1px), var(--grid) calc(var(--row) - 1px)); background-size: 100% var(--row); background-attachment: local; }
.form select { appearance: none; cursor: pointer; }
.form select option { background: var(--raise); }
.form .in:focus-within::after { content: ''; position: absolute; inset: -1px; border: 2px solid var(--lime); pointer-events: none; z-index: 2; }
.form .in:focus-within::before { content: ''; position: absolute; right: -4px; bottom: -4px; width: 7px; height: 7px; background: var(--lime); z-index: 3; }
.form .hint { padding: 0 10px; font: 11.5px/var(--row) var(--sans); color: var(--dim); white-space: nowrap; }
.seg { display: flex; gap: 0; }
.seg button { border: 0; background: transparent; padding: 0 12px; cursor: pointer; border-right: 1px solid var(--grid); font: 12px var(--mono); color: var(--dim); }
.seg button[aria-pressed="true"] { background: var(--lime); color: var(--cell); }

.bar { display: flex; gap: 10px; padding: 10px 14px; align-items: center; flex-wrap: wrap; }
.out { margin: 0 14px; border: 1px solid var(--grid); background: #0e0e0f; }
.out .sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-bottom: 1px solid var(--grid); }
.out .sum div { padding: 6px 10px; border-right: 1px solid var(--grid); }
.out .sum span { display: block; font-size: 11.5px; color: var(--dim); }
.out .sum b { font: 500 15px var(--mono); }
.out .msg { padding: 8px 10px; font: 12px/1.5 var(--mono); white-space: pre-wrap; word-break: break-word; }
.out .msg.bad { color: var(--warn); }
.out .msg.good { color: var(--lime); }

.tbl { width: 100%; border-collapse: collapse; font: 12px var(--mono); }
.tbl th { text-align: left; font: 500 11.5px var(--sans); color: var(--dim); background: var(--gutter); position: sticky; top: 0; }
.tbl th, .tbl td { height: var(--row); padding: 0 10px; border-bottom: 1px solid var(--grid); border-right: 1px solid var(--grid); white-space: nowrap; }
.tbl td.n { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.off td { opacity: .35; text-decoration: line-through; }
.tbl tr.me td { color: var(--lime); }
.scroll { max-height: calc(var(--row) * 14); overflow: auto; }
.tbl button.x { border: 0; background: transparent; color: var(--dim); cursor: pointer; font: 12px var(--mono); padding: 0 4px; }
.tbl button.x:hover { color: var(--warn); }
.prog { height: 4px; background: var(--raise2); margin: 0 14px; }
.prog i { display: block; height: 100%; width: 0; background: var(--lime); transition: width .3s; }
.linkbox { display: flex; gap: 0; margin: 0 14px; border: 1px solid var(--lime); }
.linkbox input { flex: 1; border: 0; background: transparent; padding: 0 10px; font: 12px/32px var(--mono); min-width: 0; outline: 0; }
.linkbox button { border: 0; background: var(--lime); color: var(--cell); padding: 0 14px; cursor: pointer; font: 500 12px var(--sans); }
.warnline { margin: 8px 14px 0; padding: 8px 10px; border-left: 2px solid var(--warn); background: #170f0c; font: 12px/1.5 var(--sans); color: #f0c9bc; max-width: 820px; }

/* doc pages */
.doc { padding: calc(var(--row) * 1) 14px calc(var(--row) * 2); max-width: 760px; }
.doc h2 { font: 500 22px/var(--row) var(--mono); margin: var(--row) 0 calc(var(--row) * .5); color: var(--lime); }
.doc h2:first-child { margin-top: 0; }
.doc p, .doc li { font: 14px/var(--row) var(--sans); color: #ddd6c6; }
.doc code { font: 12.5px var(--mono); background: var(--raise); padding: 1px 5px; border-radius: 3px; color: var(--ink); }

/* ---------- bottom sheet tabs ---------- */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: 40px; background: var(--gutter); border-top: 1px solid var(--grid); display: flex; align-items: stretch; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs .plus { width: 44px; display: grid; place-items: center; color: var(--dim); flex: none; font: 16px var(--mono); }
.tabs a { display: flex; align-items: center; padding: 0 16px; text-decoration: none; color: #cfc8b8; font-size: 13px; white-space: nowrap; border-right: 1px solid var(--grid); position: relative; transition: color .15s, background .15s; }
.tabs a:hover { background: var(--raise); color: var(--ink); }
.tabs a[aria-current] { background: var(--lime); color: var(--cell); font-weight: 600; }
.tabs .net { margin-left: auto; font-family: var(--sans); display: flex; align-items: center; padding: 0 14px; color: var(--dim); font-size: 12px; white-space: nowrap; }
.tabs .net i { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); margin-right: 7px; }
.tabs .net.ok i { background: var(--lime); animation: blink 2s steps(2) infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* the visitor's own cursor tag (shown only for a connected wallet) */
.tag { position: fixed; z-index: 40; pointer-events: none; background: var(--lime); color: var(--cell); font: 600 11px var(--sans); padding: 2px 7px; border-radius: 2px 8px 8px 8px; transform: translate(12px, 14px); transition: opacity .2s; white-space: nowrap; }

.toast { position: fixed; bottom: 54px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--cell); padding: 8px 14px; border-radius: 6px; font: 500 13px var(--sans); z-index: 50; }

/* reveal on scroll: cells fill in */
.rv { opacity: 0; transform: translateY(8px); transition: opacity .6s cubic-bezier(.2, .7, .2, 1), transform .6s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--d, 0) * 60ms); }
.rv.in { opacity: 1; transform: none; }

@media (max-width: 900px) {
  :root { --gut: 30px; --cols: var(--gut) repeat(8, 0) repeat(6, minmax(0, 1fr)); }
  .colhead span:nth-child(n+2):nth-child(-n+9) { display: none; }
  .colhead { grid-template-columns: var(--gut) repeat(6, minmax(0, 1fr)); }
  .lines { grid-template-columns: var(--gut) repeat(6, minmax(0, 1fr)); }
  .lines i:nth-child(n+2):nth-child(-n+9) { display: none; }
  .span-logo { grid-column: 2 / -1; }
  .logo-cell { padding: 14px 14px 0; }
  .logo-cell .pix { width: 50%; }
  .span-wide, .span-a, .span-b, .span-c, .span-ab, .span-bc { grid-column: 2 / -1; }
  .big { grid-template-columns: 1fr; }
  .menu { display: none; }
  .title .sync { display: none; }
  .title h1 { font-size: 15px; }
  .form { grid-template-columns: 1fr; }
  .form > label, .form > .lab { border-right: 0; }
  .ledger .lr { grid-template-columns: 1.2fr 1fr 1fr; }
  .ledger .lr > :nth-child(n+4) { display: none; }
  .fx { grid-template-columns: 56px 26px 1fr; }
  .paper { max-width: none; }
  .ca span.long { display: none; }
}
@media (max-width: 520px) {
  .right .ico.x, .right .ico.pf { width: 30px; height: 30px; }
  .pill { padding: 0 12px; }
  .title { gap: 8px; padding: 8px 10px 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rv { opacity: 1; transform: none; }
  .wave span { opacity: .7; }
}
