/* CHŌBA 帳場: an Edo counting-house terminal. Indigo room, washi terminal,
   a lacquered price board for the figures, and one desk window per product. */
:root {
  scrollbar-gutter: stable;
  --room: #202a2d;
  --washi: #f1ebdf; --washi-hi: #fbf7ee; --washi-lo: #e7dfcf;
  --sumi: #262923; --sumi-2: #45483f; --muted: #645c4d; --hair: #d2c6ae; --line: #a99c83;
  --ai: #213650; --ai-2: #2e4a6c; --ai-ink: #e9e1cf;
  --shu: #a63b29; --shu-dk: #842c1f; --shu-wash: #f3dfd2;
  --lacquer: #16191b; --lacquer-2: #24282b; --gold: #d4a64a; --board-ink: #f1e6cc;
  --kincha: #a2701c; --matcha: #5d7a4f;
  /* World materials: the wooden signs and tags, the paper of passbooks and fields, and light ink on dark or vermilion. */
  --wood-hi: #e6cda2; --wood-lo: #d8b688; --wood-dim: #b58b58; --wood-edge: #5a3b1f; --wood-ink: #2a1c12;
  --paper: #fbf6ea; --field-hi: #fdfaf2; --field-lo: #f5eddc; --field-rule: #8a7c63; --on-ink: #fbf3e6;
  /* Book accents, used only on the sign's cloth edge, the index tabs and the menu mark. */
  --kasane-1: #6b2315; --kasane-2: #8c2f1a; --yorozu-1: #243a31; --yorozu-2: #34523f;
  --serif: "KASANE Ink", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", "Times New Roman", serif;
  --sans: "KASANE Sans", "Hiragino Sans", "Yu Gothic", "Avenir Next", system-ui, sans-serif;
  --prose: "KASANE Text Latin", "KASANE Text JP", "Yu Mincho", Georgia, serif;
  --numbers: var(--sans);
  --ease: cubic-bezier(.2,.8,.2,1);
  --frame: 1080px;
  font-family: var(--sans); font-size: 14.5px; line-height: 1.6;
  color: var(--sumi); background: var(--room); font-synthesis: none; color-scheme: light;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 0 16px 32px;
  /* Seigaiha waves, drawn in faint strokes on the indigo room. */
  background: var(--room) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='28' viewBox='0 0 56 28'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.018'%3E%3Cpath d='M0 28a28 28 0 0 1 56 0M8 28a20 20 0 0 1 40 0M16 28a12 12 0 0 1 24 0M-28 14a28 28 0 0 1 56 0M28 14a28 28 0 0 1 56 0M-20 14a20 20 0 0 1 40 0M36 14a20 20 0 0 1 40 0'/%3E%3C/g%3E%3C/svg%3E"); }
a { color: var(--shu); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a, button, summary, input, select { transition: color 140ms, background-color 140ms, border-color 140ms, box-shadow 140ms; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: .01em; text-wrap: balance; overflow-wrap: anywhere; margin: 0; }
p { margin: 0; overflow-wrap: break-word; line-break: strict; text-wrap: pretty; }
label, dt { overflow-wrap: anywhere; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#sample-notice { position: sticky; top: 0; z-index: 21; flex-shrink: 0; width: 100%; max-width: var(--frame); padding: 5px 10px; border-bottom: 1px solid var(--shu); background: var(--washi-hi); color: var(--shu-dk); font: 500 12px/1.6 var(--sans); text-align: center; }

/* Controls */
button { cursor: pointer; min-height: 40px; max-width: 100%; padding: 8px 18px; border: 1px solid var(--shu-dk); border-radius: 2px;
  background: var(--shu); color: var(--on-ink); font-size: 13.5px; font-weight: 500; letter-spacing: .03em; overflow-wrap: anywhere; box-shadow: inset 0 -2px 0 #0000001f; }
button:active:enabled { transform: translateY(1px); box-shadow: none; }
button:disabled { cursor: not-allowed; background: var(--washi-lo); color: #8b8272; border-color: var(--hair); box-shadow: none; }
.text-button { min-height: 32px; padding: 4px 0; border: 0; background: none; color: var(--shu); font-size: 12.5px; box-shadow: none; }
.text-button:disabled { background: none; border: 0; color: var(--muted); }
.secondary { background: var(--washi-hi); color: var(--sumi); border-color: var(--line); }
input, select { width: 100%; min-width: 0; min-height: 40px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 2px; background: var(--washi-hi); font-size: 14px; box-shadow: inset 0 1px 2px #2a1c1214; }
input::placeholder { color: #9a917f; }
input:disabled, select:disabled { background: var(--washi-lo); color: var(--muted); }
input:focus, select:focus { outline: none; border-color: var(--ai); box-shadow: 0 0 0 2px #21365033; }
:is(button, a, summary, [tabindex]):focus-visible { outline: 2px solid var(--shu); outline-offset: 2px; }
select { appearance: none; padding-right: 30px; background: var(--washi-hi) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%231c2023' stroke-width='1.3'/%3E%3C/svg%3E") right 10px center / 10px 6px no-repeat; }
input[inputmode="decimal"], input[inputmode="numeric"] { font-family: var(--numbers); font-variant-numeric: tabular-nums; }
label { font-size: 12.5px; color: var(--sumi-2); }
.note { font-size: 12px; line-height: 1.65; color: var(--muted); }
/* An emptied reason keeps its box while focused, so recovering from an error never drops keyboard focus. */
.note:empty:not(:focus) { display: none; }
.note[data-reason]:not(:empty) { color: var(--shu-dk); }
.note[data-reason]:focus { outline: 2px solid var(--shu); outline-offset: 2px; }
.risk-note { font-size: 12px; color: var(--shu-dk); padding-left: 10px; border-left: 2px solid var(--shu); }

/* Disclosure rows: an ink tick instead of the browser triangle. */
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
details > summary { position: relative; display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 8px 0 8px 16px; font-size: 13px; color: var(--sumi-2); }
details > summary::before { content: ""; position: absolute; left: 2px; top: 50%; width: 6px; height: 6px; margin-top: -4px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform 180ms var(--ease); }
details[open] > summary::before { transform: rotate(45deg); margin-top: -5px; }
details[open] > :not(summary) { animation: unfold 200ms var(--ease); }
details:has(> summary:focus-visible)[open] > :not(summary) { animation: none; }
@keyframes unfold { from { opacity: 0; transform: translateY(-3px); } }

/* The terminal frame */
.skip-link { position: absolute; top: -100px; left: 16px; z-index: 5; padding: 10px 14px; background: var(--washi-hi); }
.skip-link:focus { top: 8px; }
header, main { width: 100%; max-width: var(--frame); }
main > noscript { display: block; width: 100%; max-width: var(--frame); margin-top: 12px; padding: 14px 18px; border: 1px solid var(--line); background: var(--washi-hi); }
main > noscript p + p { margin-top: 8px; }
/* Masthead: one washi strip under the KASANE ticker line (22px, reserved on every page). Seal and shop name at the left, the five menu marks in the middle, then network,
   language and wallet. Its height is fixed, so every page starts its content at the same line. */
header { position: relative; z-index: 20; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: stretch; height: 52px; margin-top: 22px;
  background: var(--washi-tex) 0 0 / 480px, var(--washi); border: 1px solid #00000059; box-shadow: inset 0 1px 0 #ffffff80, 0 12px 26px -18px #000000cc; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 20px 0 16px; border-right: 1px solid var(--hair); color: var(--sumi); text-decoration: none; font: 600 21px/1 var(--serif); letter-spacing: .14em; white-space: nowrap; }
.brand::before { content: "帳" / ""; display: grid; place-items: center; width: 30px; height: 32px; background: var(--shu); color: var(--on-ink); font-size: 17px; letter-spacing: 0; border-radius: 2px; box-shadow: inset 0 0 0 2px var(--shu), inset 0 0 0 3px #fbf3e6aa; transform: rotate(-3deg); }
.product-nav { display: flex; justify-content: center; align-items: stretch; gap: 0; min-width: 0; padding: 0 6px; }
.product-nav .book { position: relative; display: flex; }
.product-nav > a[href="/health.html"] { justify-content: center; }
@media (min-width: 1200px) { .product-nav > a[href="/health.html"] { min-width: 96px; } }
/* A menu mark: brushed icon and word; the current book or page carries its binding colour as a brush rule underneath. */
.menu-item { position: relative; display: flex; align-items: center; gap: 7px; min-height: 0; padding: 0 12px; color: var(--sumi-2); font: 600 14px/1.2 var(--serif); letter-spacing: .04em; text-decoration: none; white-space: nowrap; --rule: var(--shu); }
.book-jpydf > .menu-item, .menu-item.book-jpydf { --rule: var(--ai-2); }
.book-kasane > .menu-item, .menu-item.book-kasane { --rule: var(--kasane-2); }
.book-programs > .menu-item, .menu-item.book-programs { --rule: var(--yorozu-2); }
.nav-icon { flex: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 4.2; stroke-linecap: round; stroke-linejoin: round; overflow: visible; opacity: .78; transition: transform 140ms var(--ease), opacity 140ms; }
.menu-item[aria-current] { color: var(--sumi); }
.menu-item[aria-current] .nav-icon, .book[open] > .menu-item .nav-icon { opacity: 1; }
.menu-item[aria-current]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 5px; height: 5px; background: var(--rule);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 8' preserveAspectRatio='none'%3E%3Cpath d='M2 5.2C40 3 90 2.4 150 3.1s96 1.3 146 .4c-40 2.6-100 3.6-150 3.3S30 7 2 5.2z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 8' preserveAspectRatio='none'%3E%3Cpath d='M2 5.2C40 3 90 2.4 150 3.1s96 1.3 146 .4c-40 2.6-100 3.6-150 3.3S30 7 2 5.2z'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
/* A book's word carries a small ink tick that turns when its sheet is open. */
.product-nav summary.menu-item { padding: 0 22px 0 12px; font-size: 14px; color: var(--sumi-2); }
.product-nav summary.menu-item::before { left: auto; right: 10px; width: 5px; height: 5px; margin-top: -4px; transform: rotate(45deg); opacity: .6; transition: transform 140ms var(--ease); }
.product-nav .book[open] > summary.menu-item::before { transform: rotate(-135deg); margin-top: -1px; }
.product-nav .book[open] > summary.menu-item { color: var(--sumi); background: #ffffff59; }
/* The sheet: washi hanging from a thin rod under the menu, one row per desk with its seal. It overlays the page. */
.book-panel { position: absolute; top: calc(100% + 7px); left: 50%; translate: -50% 0; z-index: 30; display: grid; gap: 2px; width: 340px; padding: 12px 8px 8px;
  background: var(--washi-tex) 0 0 / 480px, var(--washi-hi); border: 1px solid var(--sumi); box-shadow: 0 18px 30px -16px #000c, inset 0 0 0 3px var(--washi-hi), inset 0 0 0 4px var(--hair); }
.book-panel::before { content: ""; position: absolute; left: -8px; right: -8px; top: -6px; height: 7px; border-radius: 4px; background: linear-gradient(180deg, #2c1f14, #6d4d30 45%, var(--wood-ink)); box-shadow: 0 2px 3px #00000040; }
.product-nav .book[open] > .book-panel { animation: sheet 140ms var(--ease); }
@keyframes sheet { from { opacity: 0; transform: translateY(-4px); } }
.book-panel a { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 12px; align-items: center; padding: 10px 12px 10px 8px; color: var(--sumi); text-decoration: none; }
.book-panel b { font: 600 14.5px/1.3 var(--serif); letter-spacing: .03em; }
.book-panel small { grid-column: 2; font-size: 12px; line-height: 1.5; color: var(--muted); }
.desk-seal { grid-row: span 2; display: grid; place-items: center; width: 30px; height: 32px; border: 1.5px solid var(--shu); color: var(--shu); font: 600 16px/1 var(--serif); transform: rotate(-3deg); }
.book-panel a[aria-current] { background: var(--shu-wash); box-shadow: inset 3px 0 0 var(--shu); }
.book-panel a[aria-current] .desk-seal { background: var(--shu); color: var(--on-ink); }
.book-panel a:focus-visible { outline-offset: -2px; }
header > .language-switch { display: flex; align-items: center; padding: 0 8px; border-left: 1px solid var(--hair); }
/* The wallet: a written tag at the end of the strip; connected, it shows the short address and opens its slip. */
header > #connect { align-self: stretch; margin: 0; padding: 0 18px; min-height: 0; border: 0; border-left: 1px solid var(--hair); border-radius: 0; background: transparent; box-shadow: none; color: var(--shu-dk); font: 600 13.5px/1.2 var(--serif); letter-spacing: .04em; white-space: nowrap; }
header > #connect[data-owner] { color: var(--sumi); font-family: var(--sans); font-weight: 500; letter-spacing: .02em; }
header > #connect[data-owner]::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--shu); vertical-align: 1px; }
header > #connect:disabled { color: #8b8272; }
.wallet-panel { position: absolute; top: calc(100% + 7px); right: -1px; z-index: 30; display: grid; justify-items: start; gap: 4px; width: min(320px, calc(100vw - 20px)); padding: 16px 16px 10px;
  background: var(--washi-tex) 0 0 / 480px, var(--washi-hi); border: 1px solid var(--sumi); box-shadow: 0 18px 30px -16px #000c, inset 0 0 0 3px var(--washi-hi), inset 0 0 0 4px var(--hair); animation: sheet 140ms var(--ease); }
.wallet-panel::before { content: ""; position: absolute; left: -8px; right: -8px; top: -6px; height: 7px; border-radius: 4px; background: linear-gradient(180deg, #2c1f14, #6d4d30 45%, var(--wood-ink)); }
.wallet-address { width: 100%; margin-bottom: 4px; padding: 8px 10px; border: 1px solid var(--hair); background: var(--field-hi); font: 12px/1.5 ui-monospace, "SFMono-Regular", Menlo, monospace; overflow-wrap: anywhere; }
.wallet-panel .text-button { font-family: var(--serif); font-weight: 600; }
.wallet-slip { margin: 0; max-width: 34em; font: 12.5px/1.6 var(--sans); color: var(--sumi-2); }
.wallet-slip a { color: var(--shu-dk); font-weight: 600; text-underline-offset: 2px; }
.wallet-panel .wallet-choice { width: 100%; justify-content: flex-start; padding: 8px 10px; color: var(--sumi); font-size: 14px; text-align: left; }
/* Middle widths keep one row by stacking each mark's icon over its word; the network keeps only its dot. */
@media (max-width: 1199px) {
  .brand { padding: 0 14px 0 12px; }
  .menu-item, .product-nav summary.menu-item { flex-direction: column; justify-content: center; gap: 2px; padding: 1px 12px 5px; font-size: 12px; letter-spacing: 0; }
  .nav-icon { width: 20px; height: 20px; }
  .menu-item > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .product-nav summary.menu-item::before { display: none; }
  .menu-item[aria-current]::after { left: 18%; right: 18%; bottom: 2px; height: 4px; }
}
/* Narrow screens: shop name and wallet on the first line, the six marks (icon over word) share the second;
   a book's sheet spans the strip under it. Both lines have fixed heights. */
@media (max-width: 899px) {
  header { grid-template-rows: 44px 56px; height: auto; margin-top: 8px; }
  .brand, header > .language-switch, header > #connect, header > .preview-note { grid-row: 1; }
  .brand { grid-column: 1; border-right: 0; }
  header > .language-switch { grid-column: 4; } header > #connect, header > .preview-note { grid-column: 5; }
  .product-nav { grid-column: 1 / -1; grid-row: 2; padding: 0 4px; border-top: 1px solid var(--hair); }
  /* Six marks share the row: each its word's width plus an equal part of the room left, so a long word (「Kasane 帳」) never clips. */
  .product-nav > * { flex: 1 1 auto; min-width: max-content; } .product-nav .book > summary.menu-item, .product-nav > a.menu-item { flex: 1 1 auto; width: auto; }
  .product-nav .book { position: static; }
  .menu-item, .product-nav summary.menu-item { width: 100%; padding: 2px 2px 6px; }
  .book-panel { left: 6px; right: 6px; width: auto; translate: none; }
  .wallet-panel { right: 6px; }
}
@media (max-width: 560px) {
  .brand { padding: 0 8px 0 12px; font-size: 17px; gap: 8px; }
  .brand::before { width: 26px; height: 28px; font-size: 15px; }
  header > #connect { padding: 0 12px; font-size: 12.5px; }
  header > .preview-note { padding: 0 12px; }
  header > .language-switch { padding: 0 6px; }
}
/* The narrowest phones keep the seal as the shop sign and the network as its dot; both still read out their words. */
@media (max-width: 379px) { .brand { font-size: 0; letter-spacing: 0; } .product-nav { padding: 0; } .menu-item, .product-nav summary.menu-item { padding-inline: 1px; font-size: 11px; } }
@media (max-width: 419px) {
  .language-switch select { padding-right: 20px; background-position: right 6px center; }
}
.language-switch > span { display: none; }
/* The switch only works with JavaScript; the class is set in <head> before the first paint. */
html:not(.js) .language-switch { display: none !important; }
.language-switch select { width: auto; min-height: 32px; padding: 4px 24px 4px 8px; font-size: 12px; background-color: transparent; border-color: var(--hair); box-shadow: none; background-position: right 8px center; }

main { flex: 1 0 auto; padding: 12px 0 0; }
#notice { font-size: 12.5px; color: var(--muted); }
#notice:empty { display: none; }
#notice.error { color: var(--shu-dk); padding-left: 10px; border-left: 2px solid var(--shu); }
#pending { position: relative; margin: 0 0 12px; padding: 14px 16px 14px 56px; background: #efe0bb; border: 1px solid #00000040; border-left: 3px solid var(--kincha); overflow-wrap: anywhere; }
#pending::before { content: ""; position: absolute; left: 16px; top: 14px; width: 24px; height: 34px; background: url('/assets/edo-lantern.svg') center / contain no-repeat; }
#pending h2 { font-size: 15px; margin-bottom: 2px; }
#pending p { font-size: 12.5px; }
#pending code { display: block; margin: 6px 0 8px; font-size: 11.5px; overflow-wrap: anywhere; }

/* Desk window: an indigo title bar, tabs, and a working area that keeps its size. */
.window { position: relative; background: var(--washi); border: 1px solid #00000059; box-shadow: 0 14px 30px -18px #000000cc; }
main > * + .window, .window + .drawer, .drawer + .drawer { margin-top: 12px; }
.window-bar { display: flex; align-items: center; gap: 10px; min-height: 30px; padding: 0 10px 0 12px; background: linear-gradient(90deg, var(--ai), var(--ai-2)); color: var(--ai-ink); font: 600 11.5px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; }
.window-bar .kanji { font: 600 13px/1 var(--serif); letter-spacing: .2em; color: #f0d9a8; text-transform: none; }
.window-body { padding: 14px 16px 16px; }
.window-body > #notice { margin-bottom: 10px; }
.desk-tabs { display: flex; gap: 2px; padding: 10px 12px 0; border-bottom: 1px solid var(--line); }
.desk-tabs a { min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 6px 14px 7px; color: var(--sumi-2); text-decoration: none; background: var(--washi-lo); border: 1px solid var(--line); border-bottom: 0; margin-bottom: -1px; }
.desk-tabs a span { font-size: 13px; font-weight: 500; }
.desk-tabs a small { font-size: 11px; color: var(--shu-dk); }
.desk-tabs a[aria-current="step"] { background: var(--washi-hi); color: var(--sumi); border-bottom: 1px solid var(--washi-hi); }
.desk-stage { background: var(--washi-hi); border: 1px solid var(--line); border-top: 0; margin: 0 12px 12px; padding: 16px; }

/* Fields: a label, one input with its token chip, then the dark result board. */
.field { display: grid; gap: 5px; min-width: 0; }
/* A chooser or Half / Max in the field head keeps 8px clear of the amount below (their padded boxes included). */
.field:has(> .field-head [role=radiogroup]) { gap: 8px; } .field:has(> .field-head .hint) { gap: 11px; }
.field-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px; }
.field-head .hint { margin-left: auto; text-align: right; }
.field-head label { font-size: 12.5px; color: var(--sumi-2); }
.field-head .hint { font-size: 12px; color: var(--muted); font-family: var(--numbers); }
/* Entry slips: figures are written in brush-script numerals on a ruled slip; the unit is a vermilion tag,
   and a sumi stroke appears under the slip being written. */
.amount { position: relative; display: flex; align-items: center; min-height: 44px; background: linear-gradient(180deg, var(--field-hi), var(--field-lo)); border: 1px solid var(--line); border-radius: 2px; box-shadow: inset 3px 0 0 var(--shu), inset 0 1px 0 #ffffffb0, 0 1px 0 #2a1c1212; }
.amount input { flex: 1 1 auto; min-height: 42px; padding: 4px 12px 2px 18px; border: 0; background: transparent; box-shadow: none; font: 600 20px/1.2 var(--serif); letter-spacing: .02em; color: var(--sumi); }
.amount input:focus { box-shadow: none; }
.amount input::placeholder { color: #cdc2ac; }
.amount .unit { flex: 0 0 auto; margin-right: 12px; padding: 3px 9px 2px; border: 1px solid var(--shu); outline: 1px solid #b0381f55; outline-offset: 2px; background: transparent; color: var(--shu); font: 600 13px/1.3 var(--serif); letter-spacing: .06em; transform: rotate(-2deg); }
.amount::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -7px; height: 7px; opacity: 0; transform: scaleX(.6); transform-origin: left center; transition: opacity 180ms, transform 260ms var(--ease);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 8' preserveAspectRatio='none'%3E%3Cpath d='M2 5.2C40 3 90 2.4 150 3.1s96 1.3 146 .4c-40 2.6-100 3.6-150 3.3S30 7 2 5.2z' fill='%231c2023'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.amount:focus-within { border-color: var(--sumi-2); }
.amount:focus-within::after { opacity: .85; transform: scaleX(1); }
.field select, .reserve-page main select { min-height: 48px; padding: 8px 34px 8px 14px; border: 1px solid var(--line); background-color: var(--paper); box-shadow: inset 3px 0 0 var(--ai), inset 0 1px 0 #ffffffb0; font: 600 16px/1.3 var(--serif); }
/* Small settings are ruled cells, not boxes. */
.inline-field { display: grid; grid-template-columns: minmax(0, 1fr) 132px; align-items: end; gap: 4px 14px; }
.inline-field input { min-height: 34px; padding: 4px 2px; border: 0; border-bottom: 1px dotted var(--sumi-2); border-radius: 0; background: transparent; box-shadow: none; text-align: right; font: 600 17px/1.2 var(--serif); }
.inline-field input:focus { border-bottom: 1px solid var(--shu); box-shadow: none; }
.inline-field .note { grid-column: 1 / -1; }
.inline-field > select { justify-self: end; width: auto; min-width: 96px; min-height: 34px; padding: 4px 28px 4px 10px; border: 0; border-bottom: 1px dotted var(--sumi-2); border-radius: 0; background-color: transparent; box-shadow: none; text-align: right; font: 600 16px/1.2 var(--serif); }
/* Half / Max: small written shortcuts beside the balance they draw on. */
.shortcuts { display: inline-flex; gap: 0; margin-left: 4px; white-space: nowrap; }
.shortcuts .text-button { min-height: 24px; padding: 3px 6px; margin: -3px 0; font: 600 12px/1.4 var(--serif); letter-spacing: .04em; text-decoration: underline dotted 1px; text-underline-offset: 3px; }
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.actions { display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: center; }
.actions .note { flex: 1 1 200px; }
.primary { min-width: 200px; }
/* Figures read off a small handscroll: washi between two wooden rollers, ruled in vermilion like a ledger. */
.result { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 6px 0; margin: 0 10px; padding: 12px 16px 13px;
  background: var(--washi-tex) 0 0 / 480px, var(--washi-hi); border: 0; border-block: 1px solid #2a1c122e; box-shadow: 0 3px 6px -3px #0000002e, inset 0 0 22px #5a3b1f1c; }
.result::before, .result::after { content: ""; position: absolute; top: -7px; bottom: -7px; width: 10px; border-radius: 5px; background: linear-gradient(90deg, #24180f, #7a5634 45%, #24180f); box-shadow: 0 2px 3px #0003; }
.result::before { left: -10px; }
.result::after { right: -10px; }
.result > div { min-width: 0; padding: 1px 14px; }
.result > div:first-child { padding-left: 0; }
.result > div + div { border-left: 1px solid #b0381f38; }
/* Boards with four or more figures keep two columns on wide screens, so they read as rows of a ledger. */
@media (min-width: 561px) { .result.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .result.cols-2 > div:nth-child(2n+1) { padding-left: 0; border-left: 0; } .result.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .result.cols-3 > div:nth-child(3n+1) { padding-left: 0; border-left: 0; } }
.result dt { font: 600 11px/1.5 var(--serif); letter-spacing: .1em; color: var(--shu-dk); }
.result dd { margin: 0; font: 600 18px/1.35 var(--serif); color: var(--sumi); overflow-wrap: anywhere; }
/* A seal for a level (redemption risk): 高 vermilion, 中 tea, 低 green. */
dd[data-seal]:not([data-seal=""])::before { content: attr(data-seal); display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 10px; vertical-align: 2px;
  border: 2px solid currentColor; box-shadow: inset 0 0 0 2px #fff8, 0 0 0 1px #0000000d; font: 700 16px/1 var(--serif); transform: rotate(-5deg); color: var(--shu); }
dd[data-seal="中"]::before { color: var(--kincha); }
dd[data-seal="低"]::before { color: var(--matcha); }
.callout { display: grid; gap: 8px; padding: 10px 14px; background: var(--shu-wash); border: 1px solid #b0381f40; border-left: 3px solid var(--shu); }
.callout > summary { color: var(--shu-dk); font-weight: 500; }
.callout .note { color: var(--shu-dk); }

/* Drawer: every remaining figure and setting, closed by default. */
.drawer { background: var(--washi); border: 1px solid #00000059; }
.drawer > summary { min-height: 44px; padding: 10px 12px 10px 26px; font-size: 12.5px; color: var(--sumi); }
.drawer > summary::before { left: 12px; }
.drawer[open] > summary { border-bottom: 1px solid var(--hair); }
.drawer-body { display: grid; gap: 14px; padding: 12px 14px 14px; }
.drawer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; align-items: start; }
.drawer-grid > * { min-width: 0; }
.drawer h3 { font: 600 11px/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.rows { margin: 0; }
.rows > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 0; border-bottom: 1px dotted var(--line); font-size: 12.5px; }
.rows dt { color: var(--muted); }
.rows dd { margin: 0; font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.wallet { font: 12px/1.5 ui-monospace, monospace; }
.sub-panel { padding: 10px 14px; background: var(--washi-hi); border: 1px solid var(--hair); }

/* Review before signing: a written claim (証文) with its seal. */
#preview { position: relative; margin-top: 14px; padding: 18px 20px 16px; background: var(--washi-hi); border: 1px solid var(--sumi); box-shadow: inset 0 0 0 3px var(--washi-hi), inset 0 0 0 4px var(--line); }
#preview h2 { font-size: 18px; margin-bottom: 10px; scroll-margin-top: 16px; }
#preview h2:focus { outline: none; }
#preview h2:focus-visible { outline: 2px solid var(--shu); outline-offset: 6px; }
#preview::after { content: "確" / ""; position: absolute; top: 14px; right: 16px; display: grid; place-items: center; width: 32px; height: 32px; border: 1.5px solid var(--shu); color: var(--shu); font: 600 17px/1 var(--serif); transform: rotate(-6deg); }
#preview p { font-size: 13.5px; line-height: 1.7; white-space: pre-line; }
#preview p + p { margin-top: 6px; }
#preview .note { font-size: 12px; }
#preview > button { margin-top: 14px; }
#preview .text-button { margin-left: 16px; min-width: 44px; min-height: 44px; }
#quote-deadline { color: var(--shu-dk); }
#quote-detail, #quote-fees, #quote-deadline, #detail, #fee { font-family: var(--numbers); }
/* One review format: heading = the action, a now → after table, notes, one cost line, the deadline. */
#preview h2 { padding-right: 44px; }
.review-table { width: 100%; margin: 4px 0 10px; border-collapse: collapse; table-layout: fixed; font: 13px/1.5 var(--numbers); }
.review-table th, .review-table td { padding: 5px 8px 5px 0; text-align: left; border-bottom: 1px solid var(--hair); overflow-wrap: anywhere; }
.review-table thead th { font: 500 11px/1.4 var(--sans); color: var(--muted); letter-spacing: .08em; }
.review-table tbody th { font: 400 12.5px/1.5 var(--serif); color: var(--sumi-2); }
.review-table td:last-child { font-weight: 600; color: var(--sumi); }
.review-table :is(th, td):not(:first-child) { text-align: right; }
.review-table :is(th, td):first-child { width: 40%; }
#preview :is(#quote-detail, #detail) { font-size: 12.5px; color: var(--sumi-2); }
#preview :is(#quote-fees, #fee, #quote-deadline) { font-size: 12px; color: var(--muted); }
.confirmation-tag { display: none; }
.empty { padding: 18px; font-size: 13px; color: var(--muted); border: 1px dashed var(--line); background: var(--washi-hi); }

/* LTV against the borrowing limit and the liquidation line. */
.ltv-meter { position: relative; height: 5px; background: #ffffff1c; }
.ltv-meter span { position: absolute; left: 0; top: 0; bottom: 0; width: var(--ltv); background: var(--board-ink); transition: width 400ms var(--ease); }
.ltv-meter[data-state="warn"] span { background: var(--gold); }
.ltv-meter[data-state="danger"] span { background: #e0664d; }
.ltv-meter i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--gold); }
.ltv-meter .max { left: var(--max); }
.ltv-meter .liq { left: var(--liq); background: #e0664d; }


@media (hover: hover) and (pointer: fine) {
  a:hover { color: var(--shu-dk); }
  button:hover:enabled { background: var(--shu-dk); }
  .secondary:hover:enabled { background: var(--washi-lo); color: var(--sumi); }
  .text-button:hover:enabled { background: none; color: var(--shu-dk); text-decoration: underline; }
  header > #connect:hover:enabled { background: #ffffff66; color: var(--shu-dk); }
  .menu-item:hover { color: var(--sumi); background: #ffffff59; }
  .menu-item:hover .nav-icon { opacity: 1; transform: translateY(-1px) rotate(-3deg); }
  .book-panel a:not([aria-current]):hover { background: var(--washi-lo); }
  .book-panel a:hover b { color: var(--shu-dk); }
  .desk-tabs a:not([aria-current="step"]):hover { background: var(--washi-hi); color: var(--sumi); }
  .foot-row :is(a, .text-button):hover { color: #fff; text-decoration: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media (max-width: 860px) {
  .drawer-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  body { padding: 0 10px 24px; }
  .desk-tabs { padding: 8px 8px 0; }
  .desk-tabs a small { display: none; }
  .desk-stage { margin: 0 8px 8px; padding: 12px; }
  .field-pair, .inline-field { grid-template-columns: minmax(0, 1fr); }
  .inline-field:has(> select) { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .inline-field input { text-align: left; }
  .primary { width: 100%; }
  .result dd { font-size: 17px; }
  #preview { padding: 16px 14px 14px; }
}
.bar-button { margin-left: auto; min-height: 22px; padding: 1px 10px; border: 1px solid #ffffff40; border-radius: 2px; background: #ffffff14; color: var(--ai-ink); font-size: 11px; letter-spacing: .06em; text-transform: none; box-shadow: none; }
.bar-button:disabled { background: transparent; color: #ffffff66; border-color: #ffffff26; }
@media (hover: hover) and (pointer: fine) { .bar-button:hover:enabled { background: #ffffff2e; } }
/* Status slip at the foot of a desk window: a small written note, vermilion-edged when something went wrong. */
#main-content .window > #notice { margin: -4px 12px 10px; padding: 5px 12px 6px; border: 1px solid var(--hair); border-left: 3px solid var(--line); background: var(--washi-tex) 0 0 / 480px, var(--paper); box-shadow: 0 1px 2px #2a1c1214; font: 600 13px/1.6 var(--serif); letter-spacing: .02em; color: var(--sumi-2); }
#main-content .window > #notice:empty { display: none; }
/* A read that failed on its own is said by the band or the refresh seal, not here (workspace.mjs), so the card keeps its height. */
#notice[data-quiet] { display: none !important; }
.seal-button[data-failed] { outline: 2px solid var(--shu-dk); outline-offset: -1px; }
#main-content .window > #notice.error { color: var(--shu-dk); border-color: #b0381f55; border-left-color: var(--shu); background: var(--washi-tex) 0 0 / 480px, var(--shu-wash); }

/* Native <details name> groups drawn as tabs; each keeps the same stage. */
.tabbed > details > summary { min-height: 0; padding: 7px 14px; font-size: 13px; font-weight: 500; color: var(--sumi-2); background: var(--washi-lo); border: 1px solid var(--line); }
.tabbed > details > summary::before { display: none; }
.tabbed > details[open] > summary { background: var(--washi-hi); color: var(--sumi); }
.tabbed > details > :not(summary) { background: var(--washi-hi); }
@supports selector(::details-content) {
  .tabbed { display: grid; grid-template-columns: repeat(var(--tabs, 3), minmax(0, auto)) 1fr; column-gap: 2px; padding: 10px 12px 12px; }
  .tabbed > details { display: contents; }
  .tabbed > details > summary { grid-row: 1; border-bottom: 1px solid transparent; position: relative; z-index: 1; margin-bottom: -1px; }
  .tabbed > details[open] > summary { border-bottom: 1px solid var(--washi-hi); }
  .tabbed > details::details-content { grid-row: 2; grid-column: 1 / -1; }
  /* Closed panels take no room (their contents are skipped, so the row is as tall as the open tab) and never catch a click.
     Only the card's bottom edge moves; workspace.mjs glides it. */
  .tabbed > details:not([open])::details-content { visibility: hidden; pointer-events: none; }
  .tabbed > details[open]::details-content { background: var(--washi-hi); border: 1px solid var(--line); }
  .tabbed > details[open] { z-index: 1; }
  .tabbed > details > :not(summary) { padding: 16px; animation: none; }
}
@supports not selector(::details-content) {
  .tabbed { display: grid; gap: 6px; padding: 10px 12px 12px; }
}
@media (hover: hover) and (pointer: fine) { .tabbed > details:not([open]) > summary:hover { background: var(--washi-hi); color: var(--sumi); } }
@media (max-width: 560px) { .tabbed { padding: 8px 8px 8px; } .tabbed > details > summary { padding: 7px 10px; } .tabbed > details > :not(summary) { padding: 12px; } }
.window-bar + .desk-stage { margin-top: 12px; border-top: 1px solid var(--line); }

/* Shared stage pieces. */
.stage-form { display: grid; gap: 12px; }
.preview-slot { padding: 0 12px; }
.preview-slot:has(#preview:not([hidden])) { padding-bottom: 12px; }
.preview-slot #preview { margin-top: 10px; }
.window > .callout { margin: 12px 12px 0; }
.drawer > p, .drawer > button, .drawer > div, .drawer > section { margin: 12px 14px; }
.drawer > section { padding: 0; border: 0; background: none; }
.window-bar > * { flex-shrink: 0; white-space: nowrap; }
.window-bar > span:not(.kanji):not(.hero-motion-controls) { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
:lang(ja) .window-bar .kanji { display: none; }

/* KASANE ticker: the house token's figures run along the top edge of every desk page, above the masthead;
   narrow screens leave it out (the Kasane desk shows the same figures). */
.kasane-ticker { position: absolute; top: 0; left: 0; right: 0; height: 22px; overflow: hidden; background: var(--lacquer); border-bottom: 1px solid #000; color: var(--board-ink); font: 600 11px/1 ui-monospace, "SFMono-Regular", Menlo, monospace; letter-spacing: .08em; text-transform: uppercase; }
@media (max-width: 899px) { .kasane-ticker { display: none; } }
.kasane-ticker-track { display: flex; width: max-content; animation: ticker 40s linear infinite; }
.kasane-ticker p { display: flex; margin: 0; padding: 5px 0 6px; }
.kasane-ticker span { padding: 0 20px; white-space: nowrap; }
.kasane-ticker span::after { content: "···"; margin-left: 40px; color: #ffffff40; }
.kasane-ticker b { color: var(--gold); font-weight: 600; }
.kasane-ticker:hover .kasane-ticker-track { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .kasane-ticker-track { animation: none; } .kasane-ticker p[aria-hidden] { display: none; } .kasane-ticker { overflow-x: auto; } }

/* Two ledgers and the sundry store (萬屋). A desk window's bar keeps its book's binding:
   KASANE (capital) in vermilion, JPYdf (credit) in indigo, Yorozu in pine. */
body { --book: var(--ai); --book-2: var(--ai-2); }
body.ledger-kasane { --book: var(--kasane-1); --book-2: var(--kasane-2); }
body.ledger-programs { --book: var(--yorozu-1); --book-2: var(--yorozu-2); }
.window-bar { background: linear-gradient(90deg, var(--book), var(--book-2)); }
/* A window can carry another book's binding (the Portfolio lists both ledgers). */
.window.book-kasane { --book: var(--kasane-1); --book-2: var(--kasane-2); }
.window.book-jpydf { --book: var(--ai); --book-2: var(--ai-2); }
.bar-link { margin-left: auto; color: #f0d9a8; font: 500 11.5px/1 var(--sans); letter-spacing: .04em; text-transform: none; text-decoration: none; }
.empty-row { color: var(--muted); }
#portfolio-body { display: grid; gap: 12px; }
.window-note { margin-top: 10px; color: #b9b09c; }

/* Tab icons: the paper props from edo-ui-symbols.svg name each purpose at a glance. */
.tab-icon { flex: 0 0 auto; width: 30px; height: 30px; fill: none; stroke: #343a37; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; overflow: visible; transition: transform 180ms var(--ease); }
.tabbed > details > summary, .desk-tabs a { display: flex; flex-direction: row; align-items: center; gap: 9px; }
.desk-tabs a .tab-text { display: flex; flex-direction: column; }
.tabbed > details:not([open]) > summary .tab-icon, .desk-tabs a:not([aria-current="step"]) .tab-icon { opacity: .72; filter: saturate(.6); }
@media (hover: hover) and (pointer: fine) { .tabbed > details > summary:hover .tab-icon, .desk-tabs a:hover .tab-icon { transform: translateY(-2px) rotate(-3deg); opacity: 1; filter: none; } }
/* Narrow screens: every tab takes an equal share, its mark above a short label, so four tabs fit at 320px without scrolling. */
@media (max-width: 560px) { .tab-icon { width: 22px; height: 22px; } .tabbed > details > summary, .desk-tabs a { flex-direction: column; justify-content: center; gap: 2px; min-width: 0; padding: 6px 4px; text-align: center; font-size: 12px; line-height: 1.3; overflow-wrap: anywhere; }
  .desk-tabs a { flex: 1 1 0; } .desk-tabs a span { font-size: 12px; } .tabbed { grid-template-columns: repeat(var(--tabs, 3), minmax(0, 1fr)); } }
input[inputmode="decimal"], input[inputmode="numeric"] { font-family: var(--numbers); font-weight: 500; }


/* Sumi and scroll. Working surfaces are washi, actions are brush strokes, the signing step is a hanging scroll,
   and every label is written in the house's Mincho. */
:root { --washi-tex: url('/assets/washi-paper.webp'); --brush: url('/assets/sumi-button.webp'); }
.desk-stage, .tabbed > details[open]::details-content, .tabbed > details > :not(summary), .sub-panel, .principles article, .counter, .hero-grid, .scene, .drawer[open] > :not(summary) { background-image: var(--washi-tex); background-size: 480px; }
label, dt, .field-head label, .tabbed > details > summary, .desk-tabs a, .step-label, .check, .drawer > summary, details > summary, th { font-family: var(--serif); font-weight: 600; letter-spacing: .02em; }
.note, .field-head .hint, .rows dd, td { font-family: var(--sans); }

/* Solid ink actions keep their labels legible, including disabled and secondary states. */
button:where(:not(.text-button,.bar-button,#connect,[role="radio"],#retry,.seal-button,.tag)) {
  position: relative; min-height: 44px; padding: 10px 22px; min-width: 200px; width: fit-content; max-width: 100%; justify-self: start;
  border: 1px solid var(--shu-dk); border-radius: 2px; background: var(--shu-dk); color: var(--on-ink); box-shadow: none;
  font: 500 14px/1.5 var(--sans); letter-spacing: .02em; text-shadow: none;
}
button.secondary:where(:not(.text-button,.bar-button,#connect,[role="radio"],#retry,.seal-button,.tag)) { background: var(--washi-hi); color: var(--sumi); border-color: var(--line); }
button:where(:not(.text-button,.bar-button,#connect,[role="radio"],#retry,.seal-button,.tag)):disabled { background: #ddd3bf; color: #655c4c; border-color: #c7baa2; }
@media (hover: hover) and (pointer: fine) {
 button:where(:not(.text-button,.bar-button,#connect,[role="radio"],#retry,.seal-button,.tag)):hover:enabled { background: #70291f; }
 button.secondary:where(:not(.text-button,.bar-button,#connect,[role="radio"],#retry,.seal-button,.tag)):hover:enabled { background: var(--washi-lo); }
}
.primary { min-width: 200px; }
.button { padding: 12px 22px; border: 1px solid var(--shu-dk); border-radius: 2px; background: var(--shu-dk); color: var(--on-ink); font: 500 14px/1.5 var(--sans); letter-spacing: .02em; }
.button.secondary { background: var(--washi-hi); color: var(--sumi); border-color: var(--line); }

/* A review is a ruled sheet: the transaction, then its amounts and fees. */
#preview { margin: 22px 18px; padding: 26px 28px; border: 1px solid var(--line); border-top: 3px double var(--shu); box-shadow: none; background: var(--washi-hi); }
#preview::before { display: none; }
#preview .text-button { font-family: var(--serif); }
.language-switch select { font: 500 12px/1.2 var(--sans) !important; letter-spacing: 0; }

/* Token marks: the real SOL and USDC logos, and the KASANE lacquer coin. */
.unit[data-token] { display: inline-flex; align-items: center; gap: 6px; }
.unit[data-token]::before { content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%; background: center / cover no-repeat; box-shadow: 0 0 0 1px #0000001f; }
.unit[data-token="sol"]::before { background-image: url(/assets/token-sol.webp); }
.unit[data-token="usdc"]::before { background-image: url(/assets/token-usdc.webp); }
.unit[data-token="jpydf"]::before { background-image: url(/assets/token-jpydf.svg); }
.unit[data-token="kasane"]::before { background-image: url(/assets/token-kasane.webp); }
/* hidden always wins over a component's display rule (a hidden grid still took its height). */
[hidden] { display: none !important; }
.redemption-limits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; }
@media (max-width: 860px) { .redemption-limits { grid-template-columns: minmax(0, 1fr); } }
/* Stacked figures on a narrow board need no rule between them. */
@media (max-width: 560px) { .result > div, .result > div + div { padding-left: 0; border-left: 0; } }

/* Desk index: the current book's desks. Wide screens hang them as ledger index tabs out of the paper's left edge, in the
   page margin (they take no height and stay in view); narrower screens write them as a row of pills above the desk. */
.desk-index { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 10px; }
.desk-index a { display: inline-flex; align-items: center; min-height: 28px; padding: 3px 10px; border: 1px solid #ffffff30; border-radius: 14px; color: #d9cfbc; font: 600 12px/1.2 var(--serif); letter-spacing: .03em; text-decoration: none; }
.desk-index .desk-seal { display: none; }
.desk-index a[aria-current] { background: var(--washi); color: var(--sumi); border-color: var(--washi); box-shadow: inset 3px 0 0 var(--shu); }
@media (hover: hover) and (pointer: fine) { .desk-index a:not([aria-current]):hover { color: #fff; border-color: #ffffff70; } }
/* Side tabs only where a 150px tab (a name and its "Soon" tag on one line) fits beside the frame with a 16px gutter: 1080 + 2 × 166. */
@media (min-width: 1412px) {
  .desk-index { --tab: 150px; position: sticky; top: 12px; z-index: 2; flex-direction: column; flex-wrap: nowrap; align-items: flex-end; gap: 4px; width: var(--tab); height: 0; margin: 0 0 0 calc(-1 * var(--tab)); overflow: visible; }
  .desk-index a { flex: none; width: calc(var(--tab) - 10px); gap: 7px; padding: 7px 8px 7px 9px; border: 1px solid #0000008c; border-right: 0; border-radius: 4px 0 0 4px;
    background: linear-gradient(90deg, var(--book-2), var(--book)); color: #e9e1cfd9; font-size: 12.5px; box-shadow: inset -7px 0 8px -7px #000b; }
  .desk-index .desk-seal { display: grid; flex: none; width: 20px; height: 22px; border-width: 1px; border-color: currentColor; color: inherit; font-size: 12px; transform: rotate(-3deg); }
  .desk-index a[aria-current] { width: var(--tab); background: var(--washi-tex) 0 0 / 480px, var(--washi); color: var(--sumi); border-color: #00000059; box-shadow: -4px 4px 10px -6px #000000cc; }
  .desk-index a[aria-current] .desk-seal { background: var(--shu); border-color: var(--shu); color: var(--on-ink); }
}
@media (min-width: 1412px) and (hover: hover) and (pointer: fine) { .desk-index a:not([aria-current]):hover { color: #fff; background: linear-gradient(90deg, var(--book), var(--book-2)); } }

/* World v2: the counting house. Page head = shop sign (看板) + one sentence + the market's ledger line; the action card hangs its
   tabs as wooden tags (木札) from a rail; the passbook (通帳) at its side holds the person's own figures, now → after. */
:root { --wood: url("data:image/webp;base64,UklGRgYHAABXRUJQVlA4IPoGAAAwLQCdASrgAXgAPm02lEmmIqSkICnIwA2JaWva/9tv/8Rf//vGHPHf3X+u68lf//GR2AJ3DT//tOai+Xf/nEN2ONSD/7Lvj4se5TK3Xx/5v++g2hbWNKmMf6AKaVC2ZDpRshkWqokPLy7MqM12HJfiNpWmEeToYT31a06BRJ5BXncNhUJvCUlB6+LiQHpnk5T8ps3VDup2JGUx6FYZQCxdthNplYPiUPPAmNa61Mcb3j4dhVM6maELJ7Kh+W1EngzjeJ0oPWlPxz/4ym+p4FSG+Ma5AqCwK0ABlu2Q/XiS1tOAcHDUtNPtT85jZMXOs6gaXtTiyuBo8GAFTArSiy1UfxHrgq9BX8KD7yG0ltqb3Ylm8cA/lMYsgyBSGRg9ZzWLkjdbWLJ9Q+TSQrKeZmKe6Wg9VN2gJiPuHSMqEPfh9UX2qglVBsMh6PkeeyjQBx9n9+73ZCPEzNeibAG7RHkyEJtsGv4DSodAA/vveVPFqbIAAP731BhWs/zh92fS3QL1Z360sxBMNXPkBJQMXQIXwGvuoewD7B9ENQSZvc1yMM1k3Y6JPsGMbVKdJG0oWmxZsVZnGbxPBsrYJV/1rtMsg2K4eEQOC5IDSEEJ4Euy4u4iwNGn21YBZFxE2kw8ul6/Vxgo4TXBmSVPtPnPXtpIf9w1RPg1EY1uSDKROy7ehL05BZlIHkAxTQdCAJSD2zbV7kvD+xh0LWKKikJ/213h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oT1EW4imA4tKTVhPKqiMw4Ki74qRCgdYAAAA="); }

/* Shop sign: the desk name brushed on a thin board; the book's colour is the cloth edge at its left. */
.desk-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px 14px; margin: 0 0 12px; }
.desk-title { position: relative; display: inline-flex; align-items: center; gap: 9px; height: 32px; margin: 0; padding: 0 11px 0 20px; white-space: nowrap;
  background: var(--wood) 0 0 / 240px 60px, var(--wood-lo); color: var(--wood-ink); font: 600 18px/1 var(--serif); letter-spacing: .1em;
  border: 1px solid var(--wood-ink); border-radius: 2px; box-shadow: inset 0 1px 0 #ffffff59, inset 0 -2px 3px #5a3b1f40, 0 3px 6px -2px #000c; }
.desk-title::before { content: ""; position: absolute; left: 0; top: -1px; bottom: -1px; width: 8px; background: var(--noren) 0 0 / 64px, var(--book); background-blend-mode: luminosity; border-right: 1px solid #0006; }
/* The desk's seal signs the board after its name, as a maker's seal follows the brushwork: the character and tilt of its index
   tab, about one character of the name in size. Never a currency mark. */
.desk-mark { order: 1; flex: none; display: grid; place-items: center; width: 20px; height: 21px; border-radius: 2px; background: var(--shu); color: var(--on-ink); font: 600 13px/1 var(--serif); letter-spacing: 0; transform: rotate(-3deg); }
.desk-line { min-width: 0; font: 400 16px/1.75 var(--prose); letter-spacing: normal; font-variant-numeric: normal; color: #cfc4ad; }
.desk-line a { color: #f0d9a8; }

/* Ledger line (大福帳の一行): ruled washi, vermilion rules between cells, a small Mincho label over a brush numeral. */
.ledger { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin: 0; min-width: 0; background: var(--washi-tex) 0 0 / 480px, var(--washi-hi);
  border: 1px solid #00000066; box-shadow: inset 0 0 0 2px var(--washi-hi), inset 0 0 0 3px #b0381f2e; }
.ledger > div { min-width: 0; padding: 5px 14px 6px; }
.ledger > div + div { box-shadow: inset 1px 0 0 #b0381f80, inset 3px 0 0 var(--washi-hi), inset 4px 0 0 #b0381f40; }
.ledger dt { font: 600 11px/1.5 var(--serif); letter-spacing: .06em; color: var(--shu-dk); white-space: nowrap; }
.ledger dd { margin: 0; font: 600 17px/1.35 var(--serif); color: var(--sumi); white-space: nowrap; }
body:not(:is([data-read="loading"], [data-read="failed"])) :is(.ledger > div:has(> dd[data-empty]:not([data-shown])), .ledger:not(:has(> div > dd:is(:not([data-empty]), [data-shown])))) { display: none; }
/* Units sit smaller beside their figure, with the token's mark. */
.u { margin-left: .3em; font: 600 .72em/1 var(--serif); letter-spacing: .04em; color: var(--sumi-2); white-space: nowrap; }
.u[data-token]::before { content: ""; display: inline-block; width: 1.15em; height: 1.15em; margin-right: .3em; vertical-align: -.2em; border-radius: 50%; background: center / cover no-repeat; box-shadow: 0 0 0 1px #0000001f; }
.u[data-token="jpydf"]::before { background-image: url(/assets/token-jpydf.svg); } .u[data-token="usdc"]::before { background-image: url(/assets/token-usdc.webp); }
.u[data-token="sol"]::before { background-image: url(/assets/token-sol.webp); } .u[data-token="kasane"]::before { background-image: url(/assets/token-kasane.webp); }

/* Action card at the left, passbook at the right (sticky); one column on narrow screens with the passbook first. */
.desk-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; align-items: start; }
/* Wide screens: the card on the left; the passbook's two boxes (before and after the card in the DOM) stacked on the right as one. */
@media (min-width: 900px) {
  .desk-body:has(> .pb-rest) { grid-template-rows: auto 1fr; row-gap: 0; }
  .desk-body > .action-card { grid-column: 1; grid-row: 1 / span 2; }
  .desk-body > .passbook { grid-column: 2; grid-row: 1; }
  .desk-body > .pb-rest { grid-row: 2; position: relative; top: 0; border-top: 0; padding-top: 0; box-shadow: 0 14px 30px -18px #000000cc; }
  .desk-body > .pb-top { position: relative; top: 0; border-bottom: 0; padding-bottom: 0; box-shadow: none; }
  .passbook.pb-rest::before { content: none; }
}
.desk-body > .window + * { margin-top: 0; }
main > .desk-body + * { margin-top: 12px; }
.action-card { min-width: 0; }
/* The preview has nothing to renew. */
body.desk-sample #refresh { display: none; }
/* A chooser that changes the whole card (which market) sits at its top, never in the passbook. */
.card-choice { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-height: 49px; padding: 10px 64px 5px 12px; }
/* Phones: the chooser's caption and its coins take two lines once the coins arrive; the room is kept from the first paint. */
@media (max-width: 560px) { #earn-choice { min-height: 74px; } }
.card-choice > .field-label { font: 600 12.5px/1.4 var(--serif); letter-spacing: .02em; color: var(--sumi-2); }

/* Wooden tags on a rail: the open one turns its light face and hangs from a vermilion cord. Rows are 40px. */
.tabbed, .desk-tabs { position: relative; }
.tabbed::before, .desk-tabs::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: linear-gradient(180deg, #2c1f14, #6d4d30 45%, var(--wood-ink)); box-shadow: 0 1px 2px #0005; }
.tabbed > details > summary, .desk-tabs a { position: relative; height: 32px; min-height: 0; margin-top: 8px; padding: 0 14px; gap: 7px; border: 1px solid var(--wood-ink); border-radius: 2px;
  background: linear-gradient(#2a1c128c, #2a1c12a6), var(--wood) 0 0 / 240px 60px, var(--wood-dim); color: var(--on-ink); font: 600 13.5px/1 var(--serif); letter-spacing: .06em;
  box-shadow: inset 0 1px 0 #ffffff2e, 0 2px 3px #00000040; white-space: nowrap; }
.tabbed > details > summary::after, .desk-tabs a::after { content: ""; position: absolute; left: 50%; top: -8px; width: 2px; height: 8px; margin-left: -1px; background: var(--wood-ink); }
.tabbed > details[open] > summary, .desk-tabs a[aria-current="step"], .desk:has(.borrow-intent[open]) .desk-tabs a.open { background: var(--wood) 0 0 / 240px 60px, var(--wood-hi); color: var(--wood-ink); border-color: #5a3b1f; }
.tabbed > details[open] > summary::after, .desk-tabs a[aria-current="step"]::after, .desk:has(.borrow-intent[open]) .desk-tabs a.open::after { background: var(--shu); width: 3px; margin-left: -1.5px; }
.tabbed > details > summary .tab-icon, .desk-tabs a .tab-icon { width: 20px; height: 20px; stroke: currentColor; opacity: .9; filter: none; }
.tabbed > details > summary:focus-visible, .desk-tabs a:focus-visible { outline: 2px solid var(--shu); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .tabbed > details:not([open]) > summary:hover, .desk-tabs a:not([aria-current="step"]):hover { background: linear-gradient(#2a1c1266, #2a1c1280), var(--wood) 0 0 / 240px 60px, var(--wood-dim); color: #fff; } }
@supports selector(::details-content) {
  .tabbed { column-gap: 6px; row-gap: 8px; padding: 0 12px 12px; }
  .tabbed > details > summary { margin-bottom: 0; border-bottom: 1px solid var(--wood-ink); }
  .tabbed > details[open] > summary { border-bottom: 1px solid #5a3b1f; }
  .tabbed > details > :not(summary) { padding: 14px 16px; }
}
.desk-tabs { display: flex; gap: 6px; padding: 0 12px; border-bottom: 0; }
.desk-tabs a { display: flex; flex-direction: row; align-items: center; margin-bottom: 0; }
.desk-tabs + .desk-stage, .window-bar + .desk-stage { margin: 8px 12px 12px; border-top: 1px solid var(--line); padding: 14px 16px; }

/* Settings: every tolerance of a desk sits behind one seal (定) on the rail; the slip opens over the card and takes no height. */
/* The seal is drawn 30px; its button reaches 40 × 40 for a finger, the extra 5px on each side taken back by a negative margin. */
.seal-button { position: relative; isolation: isolate; display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; margin: -5px; min-height: 0; padding: 0; border: 0; border-radius: 2px;
  background: none; box-shadow: none; color: var(--on-ink); font: 600 15px/1 var(--serif); letter-spacing: 0; cursor: pointer; }
.seal-button::before { content: ""; position: absolute; inset: 5px; z-index: -1; background-color: var(--shu); transform: rotate(-4deg); transition: background-color 140ms;
  -webkit-mask: var(--seal-sq) center / 100% 100% no-repeat; mask: var(--seal-sq) center / 100% 100% no-repeat; }
.seal-button:disabled { cursor: default; background: none; color: var(--on-ink); } .seal-button:disabled::before { background-color: #b9ae9a; }
.seal-button:focus-visible { outline: 2px solid var(--sumi); outline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .seal-button:hover:enabled::before, summary.seal-button:hover::before { background-color: var(--shu-dk); } .seal-button:hover:enabled { background: none; } }
.desk-tools { position: absolute; right: 12px; top: 10px; z-index: 3; display: flex; gap: 6px; }
.settings, .help { position: relative; }
.settings > summary.seal-button, .help > summary { padding: 0; min-height: 0; list-style: none; }
.settings > summary.seal-button::after { content: none; }
.help > summary::after { content: ""; position: absolute; inset: -8px -2px; }
details.settings > summary.seal-button::before { inset: 5px; width: auto; height: auto; margin: 0; border: 0; transform: rotate(-4deg); }
.settings[open] > summary.seal-button::before { background-color: var(--sumi); }
.slip { position: absolute; right: 0; top: calc(100% + 8px); z-index: 25; display: grid; gap: 8px; width: min(280px, calc(100vw - 40px)); padding: 12px 14px; text-align: left;
  background: var(--washi-tex) 0 0 / 480px, var(--washi-hi); border: 1px solid var(--sumi); box-shadow: 0 16px 26px -14px #000c, inset 0 0 0 3px var(--washi-hi), inset 0 0 0 4px var(--hair); }
.slip h3 { font: 600 12px/1.4 var(--serif); letter-spacing: .08em; color: var(--sumi-2); }
.slip .inline-field { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.slip .inline-field > select { min-width: 84px; }
.slip .note { font-size: 12px; }
/* Contextual help opens a note slip beside the thing it explains. */
.help { display: inline-block; vertical-align: middle; }
.help > summary { display: inline-grid; place-items: center; width: 40px; height: 28px; border: 1px solid var(--hair); border-radius: 2px; color: var(--muted); font: 500 11px/1 var(--sans); background: var(--washi-hi); }
.help > summary::before { content: none; }
.help > summary:focus-visible { outline: 2px solid var(--shu); outline-offset: 2px; }
.help[open] > summary { color: var(--sumi); background: var(--washi-hi); }
.help > .slip { width: min(300px, calc(100vw - 40px)); color: var(--sumi-2); font: 400 15px/1.75 var(--prose); letter-spacing: normal; font-variant-numeric: normal; }
.help > .slip p + p { margin-top: 6px; }
.desk-line .help > summary { color: #cfc4ad; }
.help.left > .slip { right: auto; left: 0; }

/* Passbook (通帳): stitched at the top in the book's colour, entries ruled like a ledger, now → after while typing. */
.passbook { position: sticky; top: 12px; min-width: 0; padding: 12px 14px 12px; background: var(--washi-tex) 0 0 / 480px, var(--paper); border: 1px solid #00000066;
  box-shadow: 0 14px 30px -18px #000000cc, inset 0 0 0 3px var(--paper), inset 0 0 0 4px var(--hair); }
/* The binding is the house's own wood: book accents stay on the sign's cloth edge, the index tabs and the menu mark. */
.passbook::before { content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 7px; background: radial-gradient(circle, var(--on-ink) 1.3px, transparent 1.8px) 10px 50% / 22px 7px repeat-x, var(--noren) 0 0 / 64px, var(--wood-edge); background-blend-mode: normal, luminosity; }
.pb-head { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 4px 0 6px; }
.pb-head h2 { flex: 1 1 auto; min-width: 0; font: 600 13px/1.3 var(--serif); letter-spacing: .1em; color: var(--sumi-2); }
.pb-head .token-choice { flex: none; }
.passbook dl { margin: 0; }
.passbook dl > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 0 10px; align-items: baseline; padding: 6px 0; border-top: 1px solid #b0381f2e; }
.passbook dt { font: 600 12px/1.45 var(--serif); letter-spacing: .03em; color: var(--sumi-2); }
.passbook dd { margin: 0; min-width: 0; text-align: right; font: 600 16px/1.4 var(--serif); color: var(--sumi); overflow-wrap: anywhere; }
.passbook dd.sub { grid-column: 1 / -1; font: 12px/1.5 var(--sans); color: var(--muted); }
.passbook dd.sub:empty { display: none; }
.after:empty, .after[data-empty] { display: none; }
.after { display: block; color: var(--shu-dk); font: 600 14px/1.4 var(--serif); }
.after::before { content: "→ "; color: var(--shu); }
body:not([data-book="loading"]) .passbook dl > div:is(:has(> dd:first-of-type[data-empty]), :has(> dd:first-of-type > span:first-child[data-empty])):not(:has(.after:not(:empty):not([data-empty]))) { display: none; }
.pb-more > summary { display: none; }
.pb-note { padding-top: 6px; font-size: 12px; line-height: 1.55; color: var(--muted); }
.pb-note:empty { display: none; }
dd > .pb-note { display: block; padding-top: 0; font: 12px/1.5 var(--sans); }
.pb-list { display: grid; gap: 6px; padding-top: 8px; border-top: 1px solid #b0381f2e; }
.pb-list h3 { font: 600 12px/1.4 var(--serif); letter-spacing: .08em; color: var(--sumi-2); }
/* Not connected: one sentence and the Connect stroke instead of a column of dashes, over a faint print of the desk. */
.pb-empty { display: none; gap: 10px; justify-items: start; padding: 4px 0 2px; font: 13px/1.6 var(--sans); color: var(--sumi-2); }
body:not(:has(#connect[data-owner])) .passbook .pb-empty { display: grid; }
body:not(:has(#connect[data-owner])) .passbook:not(:has(.after:not(:empty):not([data-empty]))) :is(.pb-key, .pb-more, .pb-list, .health) { display: none; }
/* An empty passbook is its one line: with nothing to show, the box after the card leaves. */
body:not(:has(#connect[data-owner])) .pb-rest:not(:has(.after:not(:empty):not([data-empty]))):not(:has(.pb-genesis:not([hidden]))) { display: none; }
body:not(:has(#connect[data-owner])) .passbook { background: linear-gradient(90deg, var(--paper) 30%, #fbf6eaa6), var(--vignette, none) right bottom / auto 100% no-repeat, var(--paper); }
body.ledger-jpydf { --vignette: url(/assets/edo-ryogae-counter.jpg); } body.ledger-kasane { --vignette: url(/assets/edo-reserve-storehouse.jpg); } body.ledger-programs { --vignette: url(/assets/edo-yorozuya-shop.jpg); }
.pb-empty button { min-width: 0; }
/* Phones: the sentence and its Connect stroke share one line, so the first box stays short above the card. */
/* Phones: the sentence, then its button under it (side by side the sentence was squeezed to three words a line). */
@media (max-width: 560px) { .pb-empty { grid-template-columns: minmax(0, 1fr); } }

/* Health seal: one character (安 注 危 無) in its own ink; the word beside it says the same for anyone who cannot see the colour. */
.health { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding-top: 8px; font: 600 12px/1.3 var(--serif); color: var(--sumi-2); }
.health-seal { position: relative; isolation: isolate; display: inline-grid; place-items: center; width: 34px; height: 34px; color: var(--on-ink); font: 600 17px/1 var(--serif); --ink: var(--muted); }
.health-seal::before { content: ""; position: absolute; inset: 0; z-index: -1; background-color: var(--ink); -webkit-mask: var(--seal-rd) center / 100% 100% no-repeat; mask: var(--seal-rd) center / 100% 100% no-repeat; transform: rotate(-8deg); }
.health[data-health="safe"] .health-seal { --ink: var(--matcha); } .health[data-health="watch"] .health-seal { --ink: var(--kincha); } .health[data-health="danger"] .health-seal { --ink: var(--shu); }

/* LTV as an ink line: the fill is brushed sumi, two notches mark the borrowing limit and liquidation, an open mark shows "after". */
.ltv-line { position: relative; height: 16px; margin: 16px 0 2px; }
.ltv-line span::after { content: attr(data-now); position: absolute; right: 0; bottom: calc(100% + 4px); transform: translateX(50%); font: 600 10.5px/1 var(--sans); color: var(--sumi-2); white-space: nowrap; }
.ltv-line::before { content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 2px; background: var(--hair); }
.ltv-line span { position: absolute; left: 0; top: 5px; height: 6px; width: min(var(--ltv, 0%), 100%); background: var(--sumi); border-radius: 2px; transition: width 400ms var(--ease); }
.ltv-line[data-state="warn"] span { background: var(--kincha); } .ltv-line[data-state="danger"] span { background: var(--shu); }
.ltv-line i { position: absolute; top: 1px; width: 2px; height: 14px; background: var(--sumi-2); }
.ltv-line .max { left: var(--max); } .ltv-line .liq { left: var(--liq); background: var(--shu); }
.ltv-line b { position: absolute; top: 3px; left: min(var(--after, -20px), 100%); width: 10px; height: 10px; margin-left: -5px; border: 2px solid var(--shu); border-radius: 50%; background: var(--paper); transition: left 300ms var(--ease); }
.ltv-line:not([style*="--after"]) b { display: none; }
.ltv-marks { display: flex; justify-content: space-between; gap: 8px; font: 11px/1.4 var(--sans); color: var(--muted); }

/* Tag choosers: short lists as token buttons or seal-shaped toggles. */
.token-choice { display: flex; flex-wrap: wrap; gap: 6px; }
.token-choice button { min-height: 30px; padding: 3px 12px 3px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--washi-lo); color: var(--sumi); font: 600 13px/1 var(--serif); box-shadow: none; }
.token-choice button[aria-checked="true"] { background: var(--washi-hi); border-color: var(--sumi); box-shadow: inset 0 0 0 1px var(--sumi); }
.token-choice button:disabled:not([aria-checked="true"]) { opacity: .55; }
.token-choice.plain button { padding: 3px 12px; }
@media (hover: hover) and (pointer: fine) { .token-choice button:not([aria-checked="true"]):hover:enabled { background: var(--washi-hi); color: var(--sumi); } }
.token-choice .soon { margin-left: 6px; font: 600 10px/1.3 var(--sans); letter-spacing: .06em; color: var(--muted); }

/* "You receive ≈" under an amount: one line that keeps its height, so the button never jumps. */
/* The receipt is the largest figure on the card (21px), above the amount typed (20px). */
.receive { min-height: 26px; font: 13px/26px var(--sans); color: var(--sumi-2); }
.receive strong { font: 600 21px/26px var(--serif); color: var(--sumi); }
/* The receipt leads; what it costs follows on its own line, smaller, each figure set off the same way. */
.receive-terms { display: block; font-size: 12px; line-height: 18px; color: var(--muted); }
.receive-terms > [id] { color: var(--sumi-2); font-variant-numeric: tabular-nums; }
.receive:has(> strong[data-empty]) { display: none; }

/* The status slip gets the 済 stamp when a transaction finalizes. */
#main-content .window > #notice[data-stamp] { position: relative; padding-right: 48px; }
#notice[data-stamp]::before, #notice[data-stamp]::after { position: absolute; right: 10px; top: 50%; width: 30px; height: 30px; margin-top: -15px; transform: rotate(-8deg); animation: stamp 200ms var(--ease) both; }
#notice[data-stamp]::before { content: ""; background: var(--shu); -webkit-mask: var(--seal-sq) center / 100% 100% no-repeat; mask: var(--seal-sq) center / 100% 100% no-repeat; }
#notice[data-stamp]::after { content: "済" / ""; display: grid; place-items: center; color: var(--on-ink); font: 600 16px/1 var(--serif); }
@keyframes stamp { from { opacity: 0; transform: scale(1.6) rotate(-2deg); } }

/* Shop sign for the remaining window bars (read-only pages): a thin board, the book's cloth edge, no dots. */
.window-bar { position: relative; min-height: 30px; padding: 0 10px 0 18px; background: var(--wood) 0 0 / 240px 60px, var(--wood-lo); color: var(--wood-ink); border-bottom: 1px solid var(--wood-ink);
  font: 600 12.5px/1 var(--serif); letter-spacing: .12em; text-transform: none; box-shadow: inset 0 1px 0 #ffffff59, inset 0 -2px 3px #5a3b1f40; }
.window-bar::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: var(--noren) 0 0 / 64px, var(--book); background-blend-mode: luminosity; }
.window-bar .kanji { color: var(--shu-dk); }
.bar-link { color: var(--shu-dk); }
.window-bar:has(.seal-button) { min-height: 40px; } .window-bar .seal-button { margin: 0 -8px 0 auto; font-size: 13px; } .window-bar .seal-button::before { inset: 8px; }

@media (max-width: 899px) {
  .desk-head { grid-template-columns: auto minmax(0, 1fr); }
  .desk-head .ledger { grid-column: 1 / -1; }
  .desk-body { grid-template-columns: minmax(0, 1fr); }
  /* Unconnected Borrow and Earn start with inputs before the empty book. */
  body:is(.borrow-page, .earn-page):not(:has(#connect[data-owner])) .desk-body > .pb-top { order: 1; }
  body:is(.borrow-page, .earn-page):not(:has(#connect[data-owner])) .desk-body > .pb-rest { order: 2; }
  .passbook { position: relative; top: 0; padding: 10px 12px; }
  .passbook.pb-rest::before { content: none; }
  /* The box after the card is drawn only when it holds something (Redeem's holds one note, usually empty). */
  .desk-body > .pb-rest:not(:has(> :not(:empty):not([hidden]))) { display: none; }
  .pb-more > summary { display: flex; min-height: 28px; padding: 4px 0 0 16px; font-size: 12px; color: var(--muted); }
  .pb-more > summary { display: flex; min-height: 44px; padding: 8px 0 8px 16px; font-size: 12px; color: var(--muted); }
  .pb-more:not([open]) > summary::before { transform: rotate(45deg); margin-top: -5px; } .pb-more[open] > summary::before { transform: rotate(-135deg); margin-top: -1px; }
  .passbook .pb-key { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
  .passbook .pb-key > div { display: block; padding: 4px 0; }
  .passbook .pb-key dd { text-align: left; font-size: 15px; }
}
@media (max-width: 560px) {
  .desk-head { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .desk-title { justify-self: start; }
  /* A figure never breaks inside its number; only the unit may drop to the next line. */
  .ledger dd { font-size: 15px; white-space: normal; overflow-wrap: normal; }
  /* Two cells to a row, whatever their figures: the band has the same rows while it is read and once it is filled. */
  .ledger { display: grid; grid-auto-flow: row dense; grid-template-columns: repeat(2, minmax(0, 1fr)); background: linear-gradient(90deg, transparent calc(50% - 2px), #b0381f40 calc(50% - 2px), #b0381f40 calc(50% - 1px), transparent calc(50% - 1px), transparent 50%, #b0381f80 50%, #b0381f80 calc(50% + 1px), transparent calc(50% + 1px)), var(--washi-tex) 0 0 / 480px, var(--washi-hi); } .ledger > div { min-width: 0; } .ledger > div + div { box-shadow: none; }
  .ledger > div { padding: 4px 10px 5px; }
  .ledger dt { white-space: normal; }
  .tabbed > details > summary, .desk-tabs a { padding: 0 6px; gap: 4px; font-size: 12.5px; letter-spacing: .02em; justify-content: center; }
  .desk-tabs { padding: 0 8px; gap: 4px; }
  .desk-tabs + .desk-stage { margin: 8px 8px 8px; padding: 12px; }
}
@media (max-width: 420px) { .tabbed > details > summary .tab-icon, .desk-tabs a .tab-icon { display: none; } }

/* One plain line at the top of a tab, and the notes that belong to a card. */
.stage-line { font: 13px/1.6 var(--sans); color: var(--sumi-2); }
.stage-line .help { margin-left: 4px; }
.pb-choice { padding: 0 0 8px; }
.token-choice button { display: inline-flex; align-items: center; gap: 4px; }
/* Wood is matte: a faint sumi wash keeps the grain from shining. */
.desk-title, .window-bar { background-image: linear-gradient(#5a3b1f1f, #5a3b1f2e), var(--wood); background-size: auto, 240px 60px; }
.passbook-card { padding: 14px 16px; background: linear-gradient(90deg, var(--paper) 35%, #fbf6eab3), var(--vignette, none) right bottom / auto 100% no-repeat, var(--paper); }
.passbook-card .pb-empty { display: grid; }
body.portfolio-page, body:not([class*="ledger-"]) { --vignette: url(/assets/edo-reserve-storehouse.jpg); }
.price-status { margin: 10px 12px 0; padding: 6px 10px; background: #efe0bb; border-left: 3px solid var(--kincha); color: var(--sumi-2); }
.price-status:empty { display: none; }
.action-card > .price-status { margin: 10px 12px 0; }
.feed-state { color: var(--shu-dk); }
/* Phones: the settings seal keeps a column of its own beside the tags. */
@media (max-width: 560px) { .action-card:has(.desk-tools) .tabbed { grid-template-columns: repeat(var(--tabs, 3), minmax(0, 1fr)) 44px; } }
.field-head .hint:has(> [data-empty]) { visibility: hidden; }
#portfolio-body > * { min-width: 0; }
.pb-more:not(:has(> :not(summary):not([hidden]))) { display: none; }
/* An amount that cannot be used says why under its own field, once. */
.field-error { margin: 4px 0 0; font-size: 12.5px; line-height: 18px; color: var(--shu-dk); }
.field input[aria-invalid="true"] { border-color: var(--shu); }
/* Portfolio: the two books side by side; each holding is one ledger line with its name and the desk that acts on it, then its
   figures and its value in yen. On phones the books stack and every figure stays in view without sideways scrolling. */
.pf-books { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.pf-books > .window { margin: 0; }
.pf-lines { margin: 0; padding: 0; list-style: none; }
.pf-line { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .7fr); gap: 10px 24px; padding: 22px 4px; border-bottom: 1px solid var(--line); }
.pf-line:last-child { border-bottom: 0; }
.pf-name { grid-area: 1 / 1; font: 600 17px/1.5 var(--serif); color: var(--sumi); }
.pf-go { grid-area: 3 / 2; justify-self: end; align-self: end; font: 600 14px/1.5 var(--sans); color: var(--shu-dk); text-decoration: underline; text-underline-offset: 4px; }
.pf-line button.pf-go { min-height: 32px; padding: 0; }
.pf-amount { grid-area: 2 / 1 / 4 / 2; font: 15px/1.7 var(--prose); color: var(--sumi-2); font-variant-numeric: tabular-nums; min-width: 0; }
.pf-amount.review-facts { display: grid; grid-template-columns: repeat(auto-fit,minmax(140px,1fr)); gap: 12px 28px; margin: 0; }
.pf-amount .review-fact-row { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; border: 0; padding: 0; }
.pf-amount .review-fact-row > span { font-size: 13px; color: var(--muted); }
.pf-amount .review-fact-row strong { font: 500 20px/1.4 var(--sans); color: var(--sumi); }
.pf-worth { grid-area: 2 / 2; justify-self: end; text-align: right; font: 500 16px/1.5 var(--sans); color: var(--sumi-2); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pf-empty { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding: 16px 4px; font: 14px/1.6 var(--prose); color: var(--muted); }
.pf-empty a { color: var(--shu-dk); font: 600 14px/1.6 var(--sans); text-underline-offset: 4px; }
.pf-valuation { margin: 0 0 18px; padding: 12px 16px; background: var(--washi-hi); font: 13px/1.7 var(--prose); color: var(--sumi-2); }
.pf-amount .review-fact-row + .review-fact-row { border-top: 0; }
.portfolio-page .desk-head .ledger > div:first-child dd { font-size: 28px; line-height: 1.4; }
.pf-books .preview-slot:has(#preview:not([hidden])) { margin-top: 12px; }
#refresh.secondary { margin: 8px 0 0; }
@media (max-width: 560px) {
  .portfolio-page .desk-head .ledger > div:first-child { grid-column: 1 / -1; padding: 12px 10px; }
  .portfolio-page .desk-head .ledger > div:not(:first-child) { border-top: 1px solid var(--line); box-shadow: none; }
  .portfolio-page .desk-head .ledger > div:first-child dd { white-space: nowrap; font-size: clamp(22px, 7vw, 28px); }
  .pf-line { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 20px 0; }
  .pf-amount { grid-area: 2 / 1; }
  .pf-worth { grid-area: 3 / 1; justify-self: start; text-align: left; }
  .pf-go { grid-area: 4 / 1; justify-self: start; margin-top: 2px; min-height: 32px; }
}
/* The page head is one washi band joined to the desk below it: the sign hangs on its left edge, the sentence is ink on the paper,
   and the market figures are ruled into its right end. It touches the action card and the passbook; nothing floats on the navy. */
.desk-head { gap: 0 14px; min-height: 52px; margin: 0; padding: 6px 0 6px 0; background: var(--washi-tex) 0 0 / 480px, var(--washi-hi);
  border: 1px solid #00000066; border-bottom: 0; box-shadow: inset 0 -1px 0 #b0381f2e; }
.desk-head .desk-title { margin-left: -1px; border-left: 0; border-radius: 0 2px 2px 0; box-shadow: inset 0 1px 0 #ffffff59, inset 0 -2px 3px #5a3b1f40, 0 2px 3px -2px #0008; }
.desk-head .desk-line { color: var(--sumi-2); }
.desk-head .desk-line a, .desk-head .desk-line .help > summary { color: var(--shu-dk); }
.desk-head .ledger { align-self: stretch; margin: -6px 0; background: none; border: 0; box-shadow: none; }
.desk-head .ledger > div { display: grid; align-content: center; box-shadow: inset 1px 0 0 #b0381f80, inset 3px 0 0 var(--washi-hi), inset 4px 0 0 #b0381f40; }
.desk-head + :is(#pending, .desk-body, .window, section, div) { margin-top: 0; }
@media (max-width: 899px) {
  .desk-head { padding: 0; gap: 0; }
  .desk-head .desk-line { padding: 6px 12px 8px; }
  .desk-head .ledger { margin: 0; border-top: 1px solid #b0381f2e; }
  .desk-head .ledger > div:first-child { box-shadow: none; }
}
@media (max-width: 560px) { .desk-head .desk-title { margin-top: 8px; } .desk-head .desk-line { padding-top: 4px; } .desk-head .ledger > div:nth-child(2n+1) { box-shadow: none; } .desk-head .ledger > div:nth-child(n+3) { border-top: 1px solid #b0381f2e; } }
/* A figure with no value is not drawn: an empty cell of a result board leaves, and a board with none leaves whole. */
.result > div:has(> dd[data-empty]) { display: none; }
.result:not(:has(> div > dd:not([data-empty]))) { display: none; }
/* After a failed first read the ledger line keeps the cells it was waiting with (their size, unseen) and says one quiet sentence
   over them, so the band neither shrinks when the read fails nor grows when a later read succeeds. */
body[data-read="failed"] .desk-head .ledger { position: relative; }
body[data-read="failed"] .desk-head .ledger > div { visibility: hidden; }
body[data-read="failed"] .desk-head .ledger::before { content: attr(data-failed); position: absolute; inset: 0; display: flex; align-items: center; padding: 0 16px; font: 12.5px/1.4 var(--sans); color: var(--shu-dk); }
body:not([data-read="failed"]) .desk-head .ledger::before, .desk-head .ledger:has(> div > dd:not([data-empty]))::before { content: none; }
/* A desk this build does not open is its band alone, finished and short: the sign, one sentence of what the desk will do (the menu's),
   "Not open yet." and the way back to the Overview, on one line where it fits; no figures, no passbook, no card. A desk that could not
   be read keeps its card for the sentence that says so. */
.desk-closed .desk-head .ledger, .desk-closed .passbook, .desk-closed #pending, .desk-closed .action-card > :not(#notice), .desk-closed #portfolio-empty { display: none !important; }
.desk-closed:not(.desk-unreadable) .desk-body { display: none; }
.desk-closed:not(.desk-unreadable) .desk-head { border-bottom: 1px solid #00000066; }
.closed-line, .closed-note, .closed-back { display: none; }
.desk-closed:not(.desk-unreadable) :is(.closed-line, .closed-note, .closed-back) { display: inline; }
.desk-closed:not(.desk-unreadable) .desk-line:has(> .closed-line) > :not(.closed-line, .closed-note, .closed-back) { display: none !important; }
.closed-note { margin-left: .35em; font-weight: 600; color: var(--shu-dk); white-space: nowrap; }
.closed-back { margin-left: .8em; font: 600 13px/1.5 var(--serif); white-space: nowrap; }
.closed-back a { color: var(--shu-dk); }
/* Wide screens: the book's print shows faintly at the band's right end, where the figures would stand. (The band keeps its height
   without them, so a desk found closed after the first paint moves nothing: below it only the footer, held by deskClosed.) */
@media (min-width: 900px) { .desk-closed:not(.desk-unreadable) .desk-head { background: linear-gradient(90deg, var(--washi-hi) 55%, #fbf5e8cc), var(--book-print, url('/assets/edo-yorozuya-shop.jpg')) right center / auto 180% no-repeat, var(--washi-hi); } }
.ledger-jpydf { --book-print: url('/assets/edo-ryogae-counter.jpg'); } .ledger-kasane { --book-print: url('/assets/edo-reserve-storehouse.jpg'); }
.desk-closed .desk-body { grid-template-columns: minmax(0, 1fr); }
.desk-closed .action-card > #notice { margin: 12px; }
.pb-caption { margin: 2px 0 4px; font: 11.5px/1.4 var(--sans); color: var(--muted); }
/* No loan yet: the passbook is its one line; a projection shows only its "after", with no empty "now" before it. */
.health[data-health="none"] { display: none; }
.passbook dd > span:first-child[data-empty]:has(~ .after:not(:empty):not([data-empty])) { display: none; }
/* Motion, quick and never in the way (all of it stops under reduced motion, see above). Pages change by plain navigation: a
   cross-document view transition snapshotted the old page with its menu sheet open and painted it over the new one. */
/* Repeated tab switches show their fields immediately. Help sheets retain their own motion. */
.tabbed > details[open] > :not(summary) { animation: none; }
/* Seals that are controls say their word beside them wherever it fits (the word is the button's own label, in the page's language):
   the passbook's and the report bars' renew seal at every width, the settings seal on wide screens (on phones it shares the tab rail). */
.pb-head .seal-button::after, .window-bar .seal-button::after {
  content: attr(aria-label); position: absolute; right: calc(100% + 1px); top: 50%; transform: translateY(-50%); white-space: nowrap;
  font: 600 11.5px/1 var(--serif); letter-spacing: .04em; color: var(--sumi-2); pointer-events: auto; }
.window-bar .seal-button::after { color: var(--wood-ink); }
/* A ringed report seal keeps to its ring while the figures below say the sentence, and always on phones (no room beside the title). */
body[data-read="failed"] .window-bar .seal-button[data-failed]::after { content: none; }
@media (max-width: 560px) { .window-bar .seal-button[data-failed]::after { content: none; } }
/* (Swap's seal sits over its field head, so it keeps to the seal.) */
@media (min-width: 900px) {
  body:not(.fx-page) details.settings > summary.seal-button::after {
    content: attr(aria-label); position: absolute; right: calc(100% + 1px); top: 50%; transform: translateY(-50%); white-space: nowrap;
    font: 600 11.5px/1 var(--serif); letter-spacing: .04em; color: var(--sumi-2); pointer-events: auto; }
}
/* Small text controls keep a finger-sized target (about 40px) without taking more room: the target reaches past the word. */
/* Half / Max carry real padding (40px tall, side by side without overlapping); the passbook's and portfolio's small links reach past their word. */
.help > summary, .passbook .reserve-note .text-button, .pf-go { position: relative; }
.passbook .reserve-note .text-button::after, .pf-go::after { content: ""; position: absolute; inset: -12px -6px; }
details.help > summary::after { content: ""; position: absolute; inset: -8px -2px; }
/* Fields read clearly on paper: the border and the placeholder keep at least 3:1 against it. A long amount is echoed with its
   thousands grouped beside the unit while it is typed (the field itself keeps plain digits). */
.amount { border-color: var(--field-rule); }
.amount input::placeholder { color: var(--field-rule); }
.amount input { min-width: 0; }
.amount .echo { flex: 0 0 auto; margin-right: 10px; white-space: nowrap; font: 500 13px/1.2 var(--serif); color: var(--muted); font-variant-numeric: tabular-nums; }
.amount .echo:empty { display: none; }
/* Vermilion is kept for the primary action and for a change that needs attention; token stamps, market labels, control seals and
   the small Half / Max words are drawn in ink. */
.amount .unit { border-color: var(--sumi-2); outline-color: #3f414555; color: var(--sumi-2); }
.ledger dt { color: var(--sumi-2); }
.seal-button::before { background-color: var(--sumi-2); }
@media (hover: hover) and (pointer: fine) { .seal-button:hover:enabled::before, summary.seal-button:hover::before { background-color: var(--sumi); } }
.settings[open] > summary.seal-button::before { background-color: var(--sumi); }
.shortcuts .text-button { color: var(--sumi-2); }
/* Borrow without a wallet: the steps still project the loan they would make, so the passbook shows it once something is typed. */
body.borrow-page:not(:has(#connect[data-owner])) .passbook:has(.after:not(:empty):not([data-empty])) .pb-empty > p:not(.wallet-slip) { display: none; }
/* FX Turbo: the knock-out is the one sentence on the desk that needs attention. */
.knock { padding: 2px 0 2px 10px; border-left: 2px solid var(--shu); font: 500 13.5px/1.55 var(--sans); color: var(--sumi); }
.knock:empty { display: none; }
/* FX Turbo's conditions: four short ruled lines, word then figure. */
.turbo-terms > div { justify-content: flex-start; padding: 3px 0; } .turbo-terms dt { flex: 0 0 8em; } @media (max-width: 560px) { .turbo-terms > div { padding: 2px 0 4px; } .turbo-terms dt { flex-basis: 6.5em; } .turbo-terms dd { font-size: 12.5px; line-height: 1.3; } } .turbo-terms dd { text-align: left; font-size: 13px; } #series-knock { color: var(--shu-dk); }
/* Breathing room (padding check): the sign and the band keep their text off their edges, help labels hold their text, tags
   hold their stamps, folded passbook sections and the Turbo knock-out keep their distance, and five tags fit a phone. */
.desk-title { height: 36px; line-height: 1; }
/* Wide screens: the band is tall enough for a two-line sentence beside its figures, so the sentence can rewrap while the figures
   arrive (their cells change width) without the band changing height. */
@media (min-width: 900px) { .desk-head { padding-block: 8px; min-height: 63px; } }

.token-choice button { min-height: 34px; }
.knock { padding-left: 12px; }
@media (max-width: 420px) { .tabbed > details > summary, .desk-tabs a { padding: 0 3px; font-size: 11.5px; letter-spacing: 0; } }
/* The band also joins what follows a hidden pending notice. */
.desk-head + #pending[hidden] + * { margin-top: 0; }
/* FX Turbo, your cards: one ruled entry per holding; its exit field is the house's amount field, its actions beside it. */
.card-entry { display: grid; gap: 4px; padding: 10px 0 12px; border-bottom: 1px dotted var(--line); }
.card-entry:first-child { padding-top: 0; }
.card-name { font: 600 14px/1.4 var(--serif); color: var(--sumi); } .card-name small { font: 600 10.5px/1 var(--sans); letter-spacing: .08em; color: var(--muted); }
.card-figs, .card-exit { font: 12.5px/1.55 var(--sans); color: var(--sumi-2); }
.card-value { margin: 2px 0 0; font: 500 12.5px/1.55 var(--sans); color: var(--sumi); font-variant-numeric: tabular-nums; } .card-value:empty { display: none; }
.card-act { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 6px; }
.card-act .amount { flex: 0 1 200px; min-height: 44px; } .card-act .amount input { min-height: 42px; font-size: 20px; }
@media (max-width: 560px) { .card-act .amount { flex: 1 1 100%; } }
/* Report pages while their first read is out or failed, or when closed: the band speaks for them, and the windows below wait. */
.rows > div:has(> dd[data-empty]) { display: none; }
body:is([data-read="loading"], [data-read="failed"], .desk-closed) main > section.window:not(:has(#notice)) { display: none; }
body.desk-closed main > section.window:has(#notice) > :not(#notice):not(.window-bar), body:is([data-read="loading"], [data-read="failed"]) main > section.window:has(#notice) > :not(#notice):not(.window-bar):not(.two-figures) { display: none; }
.desk-closed main > section.window:has(#notice) > .window-bar { display: none; }
.desk-closed:not(.desk-unreadable) main > section.window:has(#notice) { display: none; }
/* The design preview (no workspace): the ledger line wears an "Example figures" tag; the header's Connect gives way to a quiet note. */
body.desk-sample[data-read] .desk-head .ledger:has(> div > dd)::before { content: attr(data-example); align-self: center; justify-self: start; margin: 0 4px 0 10px; padding: 1px 7px; border: 1px solid #b0381f66; border-radius: 2px; font: 600 11px/1.5 var(--serif); letter-spacing: .06em; color: var(--shu-dk); white-space: nowrap; }
.preview-note { align-self: center; padding: 0 14px; border-left: 1px solid var(--hair); font: 600 12px/1.4 var(--serif); letter-spacing: .04em; color: var(--sumi-2); white-space: nowrap; }

/* Nothing moves after a page appears (stability-brief.md). Every slot whose content arrives after a read has its final size from the
   first paint (the page's HTML starts in its reading state, and first-paint in each page paints what this tab last knew); notices go
   into slots that already exist, never above the tags or the first input. */
/* While the first read is out the band keeps each expected figure's cell: its label written, a faint ink wash where the figure will
   stand. Cells not expected (remembered empty, or another state's) wait unseen. */
body:is([data-read="loading"], [data-read="failed"]) .ledger > div:not(:has(> dd[data-wait])) { display: none; }
body:is([data-read="loading"], [data-read="failed"]) .ledger :is(dd[data-wait], dd[data-shown][data-empty]), body[data-book="loading"] .passbook [data-wait] { color: transparent; }
body:is([data-read="loading"], [data-read="failed"]) .turbo-terms dd { color: transparent !important; background: linear-gradient(90deg, #2a1c1214, #2a1c1209); }
/* TURBO with several underlyings: segmented desk tabs; after a switch the figures wash, as on the first read, until that desk is read. */
.desk-head > .desk-choice { grid-column: 1 / -1; margin: 0; padding: 2px 12px 10px; }
body[data-desk-loading] .turbo-terms dd { color: transparent !important; background: linear-gradient(90deg, #2a1c1214, #2a1c1209); }
body[data-desk-loading] :is(#buy-payoff, #holdings) { opacity: .25; }
body:is([data-read="loading"], [data-read="failed"]) .ledger :is(dd[data-wait], dd[data-shown][data-empty]) { min-width: min(7em, 100%); background: linear-gradient(90deg, #2a1c1214, #2a1c1209) 0 55% / 100% .8em no-repeat; }
/* A band of the person's own figures (Portfolio) has none to wait for without a wallet. */
body:not(:has(#connect[data-owner])) .ledger[data-mine] > div { display: none !important; }
/* Its figures are short (a yen amount each): the wash is as wide as they are, so the sentence beside them keeps its lines. */
body:is([data-read="loading"], [data-read="failed"]) .ledger[data-mine] dd[data-wait] { min-width: 4.5em; }
/* The passbook while the connected wallet's first read is out: the rows it had last time (a fresh wallet's the first time), washed. */
body[data-book="loading"] .passbook dl > div:not(:has([data-wait])) { display: none; }
body[data-book="loading"] .passbook [data-wait] { background: linear-gradient(90deg, #2a1c1214, #2a1c1209) 100% 55% / 6em .8em no-repeat; }
body[data-book="loading"] .passbook span[data-wait] { display: inline-block; min-width: 6em; vertical-align: top; }
body[data-book="loading"] .passbook :is(.after, .health, .pb-note:not(:empty)) { visibility: hidden; }
/* The wallet's tag keeps one width for "Connect wallet", "Connecting…" and the short address, so nothing in the masthead moves. */
header > #connect { min-width: 10.5em; }
header > #connect[data-remembered] { color: var(--sumi); font-family: var(--sans); font-weight: 500; letter-spacing: .02em; }
/* A hint that arrives with the first read keeps its line from the first paint (two on phones), so the steps under it stay put. */
.note.reserve-line, .note.reserve-line:empty { display: block; min-height: calc(1.65em * var(--lines, 1)); }
@media (max-width: 560px) { .note.reserve-line { --lines: 2; } }
/* Phones: a field's balance and its Half / Max take their own line under the label from the first paint (they arrive with the read). */
@media (max-width: 560px) { .field-head .hint { flex-basis: 100%; } }
/* Phones: Half and Max are 40px targets 8px apart. Each reaches up over the label's air (19px) and only 3px down, so it keeps 8px
   clear of the input under it (the field's 11px gap); where a chooser sits right above the balance (Swap), the head's rows part to
   keep 8px from it too. Where the balance leaves no room for both, they take the next line, as one. */
@media (max-width: 560px) {
  .shortcuts { gap: 8px; margin-left: 8px; }
  .shortcuts .text-button { display: inline-grid; place-items: end center; min-width: 40px; min-height: 40px; padding: 0 6px 3px; margin: -19px 0 -3px; line-height: 18px; vertical-align: bottom; }
  .field-head:has(> [role=radiogroup]):has(> .hint) { row-gap: 27px; }
}
/* ... but only where one will show: without a wallet an empty hint (every one of them waits for the wallet) takes no line, so the
   label sits a small, even gap above its input. A remembered wallet is painted connected from the first paint and keeps the line. */
@media (max-width: 560px) { body:not(:has(#connect[data-owner])) .field-head .hint:has(> [data-empty]) { display: none; } }
/* Without a wallet each primary action gives its place to one that connects (workspace.mjs writes it after the primary). */
.sign-connect { display: none; }
body:not(.desk-sample):not(:has(#connect[data-owner])) .action-card .primary:not(.sign-connect) { display: none; }
body:not(.desk-sample):not(:has(#connect[data-owner])) .action-card .primary:not([hidden]):not(.sign-connect) + .sign-connect { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
/* An account that must be created first takes the primary action's place in its panel; its reason is written under it. */
.actions:has(> #setup:not([hidden])) > .primary:not(#setup) { display: none !important; }
/* A desk that is not open yet wears a small tag in the menus; a desk in its founding sale wears "Genesis" on its index tab and sign. */
:is(.book-panel, .desk-index, .book-desks) a:is([data-soon], [data-tag])::after { content: attr(data-soon) attr(data-tag); margin-left: 6px; padding: 0 5px; border: 1px solid currentColor; border-radius: 2px; font: 600 10px/1.5 var(--sans); letter-spacing: .06em; opacity: .7; }
.book-panel a[data-soon]::after { position: absolute; right: 12px; top: 12px; }
/* The index tabs at the side of wide screens: the tag sits after the name on its line, as in the menus, in a tab of the same height,
   so a desk found closed after the first paint changes no tab's size. */
@media (min-width: 1412px) {
  .desk-index a { height: 38px; padding-block: 0; }
  .desk-index a > span:not(.desk-seal) { min-width: 0; line-height: 1.15; }
  .desk-index a:is([data-soon], [data-tag])::after { flex: none; margin-left: -1px; }
}

/* Site footer (after jpydf-v2's): one thin row under an engraved hairline, small washi-coloured text on the dark ground; the house and
   the exit (Redeem) at the left, help, disclosures and the network at the right. 40px targets; it wraps on phones. Short pages keep it
   at the foot of the window (body is a column and main takes the room). */
.site-foot { width: 100%; max-width: var(--frame); margin-top: 16px; color: var(--hair); }
/* Report pages fill in below the band after their read (windows, tables, lists growing downward): their footer starts under the
   window's fold, so that growth never moves it in view. */
:is(.reports-page, .dashboard-page) main { min-height: 100vh; }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0 16px; border-top: 1px solid #0000008c; box-shadow: 0 1px 0 #e9e1cf1f inset; }
.foot-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0 14px; min-width: 0; }
.foot-row :is(a, .text-button) { display: inline-flex; align-items: center; min-height: 39px; padding: 0 2px; border: 0; background: none; color: var(--hair); font: 12px/1.2 var(--sans); letter-spacing: .02em; text-decoration: none; white-space: nowrap; }
.site-foot a.foot-brand { gap: 8px; color: var(--washi); font: 600 13px/1 var(--serif); letter-spacing: .14em; }
.foot-brand::before { content: "帳" / ""; display: grid; place-items: center; width: 18px; height: 20px; background: var(--shu); color: var(--on-ink); font-size: 11px; letter-spacing: 0; border-radius: 1px; transform: rotate(-3deg); }
.site-foot .network { min-width: 6.5em; text-align: right; font: 11px/1.2 var(--sans); letter-spacing: .08em; color: var(--line); }
/* The network's room is kept while it is unnamed (the build's configuration is read after the first paint), so the links never slide. */
.site-foot .network:not([data-named]) { visibility: hidden; }
.foot-icon { flex: none; width: 16px; height: 16px; margin-right: 5px; fill: none; stroke: currentColor; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.foot-links { margin-left: auto; }
/* Phones: at most two rows: the house and the network on the first, the entries on the second (GitHub and X by their marks). */
@media (max-width: 560px) { .foot-row .network { order: 1; margin-left: auto; } .foot-links { order: 2; flex-basis: 100%; flex-wrap: nowrap; gap: 0 10px; margin-left: 0; }
  .foot-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } .foot-icon { margin-right: 0; } }
@media (max-width: 380px) { .foot-links { gap: 0 6px; } .foot-row .foot-links :is(a, .text-button) { font-size: 11px; } }
/* Terms and Privacy: one washi dialog in the type of the "?" slips, scrolling inside itself. */
dialog.about { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; padding: 18px 20px 10px; border: 1px solid var(--sumi); color: var(--sumi-2);
  background: var(--washi-tex) 0 0 / 480px, var(--washi-hi); box-shadow: 0 18px 30px -16px #000c, inset 0 0 0 3px var(--washi-hi), inset 0 0 0 4px var(--hair); font: 12.5px/1.6 var(--sans); }
dialog.about::backdrop { background: #17212ea6; }
dialog.about section + section { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--hair); }
dialog.about h2 { margin-bottom: 6px; font-size: 15px; scroll-margin-top: 18px; } dialog.about h2:focus { outline: none; }
dialog.about h3 { margin: 12px 0 4px; font: 600 12px/1.4 var(--serif); letter-spacing: .08em; color: var(--sumi-2); }
dialog.about p + p { margin-top: 6px; } .about-lede { color: var(--muted); }
.about-terms { display: grid; grid-template-columns: minmax(0, 11em) minmax(0, 1fr); gap: 6px 14px; margin: 8px 0 0; }
.about-terms dt { font: 600 12px/1.6 var(--serif); color: var(--sumi); } .about-terms dd { margin: 0; }
/* Addresses: filled when the dialog opens (workspace.mjs); a row without a value is not shown, and without any the list and its lede leave. */
.about-addresses dd { font: 500 12.5px/1.6 var(--sans); font-variant-numeric: tabular-nums; color: var(--sumi); } .about-addresses dd:empty, .about-addresses dt:has(+ dd:empty) { display: none; }
.about-addresses-box:not(:has(dd:not(:empty))) { display: none; }
.about-channels { display: flex; flex-wrap: wrap; gap: 0 18px; margin: 0; padding: 0; list-style: none; } .about-channels a { display: inline-flex; align-items: center; min-height: 40px; color: var(--shu-dk); }
@media (max-width: 560px) { .about-terms { grid-template-columns: minmax(0, 1fr); gap: 0; } .about-terms dd { margin-bottom: 6px; } }
dialog.about form { display: flex; justify-content: flex-end; margin-top: 8px; } dialog.about form .text-button { min-height: 40px; font: 600 13px/1.2 var(--serif); }
/* History charts (web/chart.mjs): ink on washi, three ruled levels, one vermilion line at most. The plot box has a fixed height. */
.chart-empty { margin: 0; font: 13px/1.5 var(--sans); color: var(--sumi-2); }
.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin-bottom: 10px; }
.chart-tags button { min-height: 30px; font-size: 12.5px; }
.chart-plot { position: relative; height: 140px; }
.chart-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart-plot .rule { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-plot .line { fill: none; stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart-plot .line.ink { stroke: var(--sumi); } .chart-plot .line.shu { stroke: var(--shu); } .chart-plot .line.soft { stroke: var(--sumi); stroke-opacity: .45; stroke-dasharray: 5 4; }
.chart-plot .wash { fill: var(--sumi); stroke: none; } .chart-plot .edge { fill: none; stroke: var(--sumi); stroke-opacity: .55; stroke-width: 1; vector-effect: non-scaling-stroke; }
.wash-0 { fill-opacity: .1; } .wash-1 { fill-opacity: .22; } .wash-2 { fill-opacity: .36; }
.chart-levels { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart-levels span { align-self: flex-start; margin: -8px 0; padding: 0 4px 0 0; background: var(--washi-hi); font: 11px/16px var(--sans); color: var(--muted); }
.chart-axis { display: flex; justify-content: space-between; margin-top: 10px; font: 11px/1.4 var(--sans); color: var(--muted); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 6px 0 0; padding: 0; list-style: none; font: 12.5px/1.5 var(--sans); color: var(--sumi-2); }
.chart-legend b { font: 600 13px/1.5 var(--serif); color: var(--sumi); }
.chart-legend .chart-at { color: var(--muted); font-size: 12px; }
.chart-legend .swatch { display: inline-block; width: 18px; height: 0; margin-right: 6px; vertical-align: middle; border-top: 2px solid var(--sumi); }
.chart-legend .swatch.shu { border-color: var(--shu); } .chart-legend .swatch.soft { border-top-style: dashed; opacity: .6; }
.chart-legend .swatch[class*="wash-"] { height: 10px; border: 0; background: var(--sumi); } .chart-legend .swatch.wash-0 { opacity: .15; } .chart-legend .swatch.wash-1 { opacity: .3; } .chart-legend .swatch.wash-2 { opacity: .45; }
.chart-figures { margin-top: 6px; } .chart-figures > summary { font: 600 12px/1.4 var(--serif); color: var(--sumi-2); cursor: pointer; min-height: 32px; display: inline-flex; align-items: center; }
.chart-scroll { max-height: 280px; overflow: auto; }
.chart-table { width: 100%; border-collapse: collapse; font: 12.5px/1.4 var(--sans); }
.chart-table th { position: sticky; top: 0; background: var(--washi-hi); text-align: right; font: 600 11px/1.4 var(--sans); color: var(--muted); padding: 4px 0 4px 10px; border-bottom: 1px solid var(--line); }
.chart-table td { text-align: right; padding: 4px 0 4px 10px; border-bottom: 1px dotted var(--line); white-space: nowrap; }
.chart-table :is(th, td):first-child { text-align: left; padding-left: 0; }
@media (max-width: 560px) { .chart-plot { height: 112px; } }
/* Phones: every chart choice stays in view, wrapping onto a second row rather than running off the edge. */
@media (max-width: 560px) { .chart-tags { flex-wrap: wrap; width: 100%; } .chart-tags button { flex: none; } }

/* Air around the band (owner, 2026-09-29): one set of static values for every desk and report page. On wide screens the header
   stands 18px above the band, the shop sign hangs 14px inside the band (so the index tab and the sign never touch), and the tags
   hang 14px below the rail on longer cords; the first line of a card without tags gets the same air. Phones gain only a little,
   so every primary button stays in the first screen. */
@media (min-width: 900px) {
  main { padding-top: 18px; }
  .desk-head .desk-title { margin-left: 14px; border-left: 1px solid var(--wood-ink); border-radius: 2px; }
  .tabbed > details > summary, .desk-tabs a { margin-top: 14px; }
  .tabbed > details > summary::after, .desk-tabs a::after { top: -14px; height: 14px; }
  .desk-tools { top: 16px; }
  .card-choice { padding-top: 15px; }
  .action-card > :is(.desk-tools, .desk-tabs[hidden]) + .desk-stage { margin-top: 14px; }
  /* Cards without tags: the settings seal sits inside the paper box's top-right corner, never across its edge. */
  .action-card:has(> :is(.desk-tools, .desk-tabs[hidden]) + .desk-stage) > .desk-tools { top: 22px; right: 22px; }
}
@media (max-width: 899px) {
  .action-card > :is(.desk-tools, .desk-tabs[hidden]) + .desk-stage { margin-top: 12px; }
  .action-card:has(> :is(.desk-tools, .desk-tabs[hidden]) + .desk-stage) > .desk-tools { top: 20px; right: 18px; }
  .desk-head .desk-title { margin-left: 12px; border-left: 1px solid var(--wood-ink); border-radius: 2px; }
  .tabbed > details > summary, .desk-tabs a { margin-top: 12px; }
  .tabbed > details > summary::after, .desk-tabs a::after { top: -12px; height: 12px; }
  .desk-tools { top: 14px; }
}
@media (max-width: 1411px) { .desk-index { margin-bottom: 12px; } }

/* One Connect per desk (owner, 2026-09-29): the card's "Connect wallet to sign" is the only one in the page; the passbook without a
   wallet keeps its heading and one quiet sentence, and no Refresh seal (nothing to refresh). On narrow screens the passbook sits above
   the card, so its empty state is as tall as the two key figures it will show: connecting does not move the card. */
body:not(.lending-page):not(:has(#connect[data-owner])) .passbook .pb-head .seal-button { visibility: hidden; }
@media (max-width: 899px) { .passbook .pb-empty { min-height: 47px; align-content: center; } }
/* ... and connected it keeps that height whatever the read finds (the wallet's first read, a loan, none yet), so neither a connect nor
   its read moves the card under it. */
@media (max-width: 899px) { body:has(#connect[data-owner]) .passbook.pb-top > .pb-key { min-height: 47px; }
  /* With nothing held yet that room shows the desk's print, as the passbook without a wallet does, rather than a blank. */
  body:has(#connect[data-owner]):not([data-book="loading"]) .passbook.pb-top:not(:has(> .pb-key > div > dd:first-of-type > span:first-child:not([data-empty])), .after:not(:empty):not([data-empty])) { background: linear-gradient(90deg, var(--paper) 30%, #fbf6eaa6), var(--vignette, none) right bottom / auto 100% no-repeat, var(--paper); } }
/* Borrow's managing view painted from memory, until the page's script has placed its forms: the card keeps the height it had and its
   chooser and panels wait unseen (first-paint sets view-wait; borrow-app.mjs lifts it). */
.view-wait .action-card :is(#manage-choice, .borrow-intents) { visibility: hidden; }
/* While a loan's first read is out (the managing view), its health seal and LTV line keep their room, unseen. */
body[data-book="loading"]:has(.borrow-intents:not([hidden])) .passbook :is(.health[data-health="none"], #ltv-meter[hidden]) { display: flex !important; visibility: hidden; }
body[data-book="loading"]:has(.borrow-intents:not([hidden])) .passbook #ltv-meter[hidden] { display: block !important; }

/* The sign's small tag during the founding sale, the same tag as the desk's index tab. */
.desk-tag { padding: 0 5px; border: 1px solid currentColor; border-radius: 2px; font: 600 10px/1.5 var(--sans); letter-spacing: .06em; opacity: .75; }
/* Phones: the review scroll gives its content the width, so "Sign this transaction" stays one line in its 44px brush box. */
@media (max-width: 560px) { #preview { margin-inline: 12px; padding: 24px 16px 20px; } #preview::before { left: -9px; right: -9px; } }
/* The review's labels get the wider column; Japanese breaks between phrases, never inside one (「受け取 / る」), wherever a desk writes. */
.review-table thead th:first-child { width: 42%; }
:lang(ja) :is(.desk-head, .action-card, .passbook, #preview) { word-break: auto-phrase; }
.desk-line { text-wrap: balance; }
/* The KASANE book is named in capitals (a token name); capitals are set a size smaller so the one-row menu keeps its width. */
@media (min-width: 1200px) { .product-nav .book-kasane > summary.menu-item { padding-right: 19px; } .product-nav .book-kasane > summary.menu-item > span { font-size: 13px; letter-spacing: 0; } }
/* FX Turbo's payoff figure (web/payoff.mjs): three lanes of numbers around a fixed-height plot, one lane per vertical mark so their
   numbers never collide; each label sits at its mark, shifted back by the same share of its own width so it stays inside the box.
   The box keeps its height from the first paint and holds a wash until the first read. */
.payoff { display: grid; grid-template-rows: 16px 16px 96px 16px; row-gap: 3px; margin: 0 0 4px; }
.payoff.small { grid-template-rows: 16px 16px 56px 16px; margin: 8px 0; }
.payoff:empty { background: linear-gradient(90deg, #2a1c1214, #2a1c1209); }
.pay-lane { position: relative; font: 11.5px/16px var(--sans); color: var(--sumi-2); }
.pay-mark { position: absolute; left: var(--x); transform: translateX(calc(var(--x) * -1)); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pay-mark::after { content: ""; position: absolute; left: var(--x); top: 100%; height: 3px; border-left: 1px solid currentColor; }
.pay-mark.even::after { top: auto; bottom: 100%; }
.pay-mark.shu { color: var(--shu-dk); } .pay-mark.ink { color: var(--sumi); font-weight: 600; }
.pay-plot { position: relative; }
.pay-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pay-plot :is(.rule, .pay, .price, .even, .barrier, .now) { fill: none; vector-effect: non-scaling-stroke; }
.pay-plot .rule { stroke: var(--line); stroke-width: 1; }
.pay-plot .out { fill: var(--sumi); fill-opacity: .07; }
.pay-plot .pay { stroke: var(--sumi); stroke-width: 2; stroke-linejoin: round; } .pay-plot .pay.spent { stroke-opacity: .3; }
.pay-plot .price { stroke: var(--sumi); stroke-opacity: .6; stroke-width: 1; stroke-dasharray: 5 4; }
.pay-plot .even { stroke: var(--sumi); stroke-opacity: .4; stroke-width: 1; stroke-dasharray: 2 3; }
.pay-plot .barrier { stroke: var(--shu); stroke-width: 1.5; }
.pay-plot .now { stroke: var(--sumi); stroke-width: 1; }
.pay-level { position: absolute; left: 0; top: var(--y); transform: translateY(-100%); padding: 0 4px 1px 0; font: 11px/14px var(--sans); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pay-level.far { left: auto; right: 0; padding: 0 0 1px 4px; }
/* The cap's label hangs under its line, where the ramp never reaches, so it keeps clear of the lane above. */
.pay-level.cap { transform: none; padding-top: 1px; }
#preview .payoff { max-width: 560px; }
/* Phones: a shorter plot and tighter lanes keep Turbo's buy button in the first screen (world-v2 A2). */
@media (max-width: 560px) { .payoff { grid-template-rows: 14px 14px 48px 14px; row-gap: 2px; } .pay-lane { font-size: 11px; line-height: 14px; } .pay-level { font-size: 10.5px; line-height: 12px; } }
/* In the short figures (a held card, any phone) the price label takes the far corner, so it never stacks onto the cap's. */
.payoff.small .pay-level.price { left: auto; right: 0; padding: 0 0 1px 4px; }
@media (max-width: 560px) { .pay-level.price { left: auto; right: 0; padding: 0 0 1px 4px; } }

/* Explanatory copy uses the book faces; controls and financial figures keep their UI faces. */
.hero-copy > p, .principles p:not(.book-figure), .borrowing-guide p,
.about p, .about dd, .reserve-page .bond-lede, .redeem-page .order-lede,
.genesis-desk > .stage-line {
  font-family: var(--prose);
  font-weight: 400;
  font-variant-numeric: normal;
  letter-spacing: normal;
}

/* Reserve two text lines before market figures arrive and narrow the explanation. */
@media (min-width: 900px) { .desk-head { min-height: 74px; } .desk-head .desk-line { min-height: 56px; } }

/* Paper stays quiet behind working text; wood and seals mark actions, not every surface. */
.desk-stage, .tabbed > details[open]::details-content, .tabbed > details > :not(summary),
.sub-panel, .counter, .hero-grid, .drawer[open] > :not(summary) { background-blend-mode: soft-light; }
.desk-head, header { background-blend-mode: soft-light; }
.desk-title { background-blend-mode: soft-light; box-shadow: inset 0 1px 0 #fff8, 0 1px 2px #29231c26; }
.tabbed > details > summary, .desk-tabs a {
  background: var(--washi-lo); color: var(--sumi-2); border-color: var(--line);
  box-shadow: none; text-shadow: none;
}
.tabbed > details[open] > summary, .desk-tabs a[aria-selected="true"], .desk-tabs a[aria-current="step"] {
  background: var(--paper); color: var(--shu-dk); box-shadow: inset 0 -3px var(--shu);
}
@media (hover: hover) and (pointer: fine) {
  .tabbed > details:not([open]) > summary:hover, .desk-tabs a:hover { background: var(--washi-hi); color: var(--sumi); }
}
.amount { background: var(--field-hi); box-shadow: inset 3px 0 0 var(--shu); }
.amount .unit { transform: none; outline: none; border: 0; background: none; letter-spacing: 0; font-family: var(--sans); font-weight: 500; }
.pb-empty > p { font: 400 15px/1.7 var(--prose); }

/* Keep market figures on their own ruled line so they never squeeze the introduction. */
@media (min-width: 900px) {
  .desk-head { grid-template-columns: auto minmax(0, 1fr); }
  .desk-head > .desk-line { padding-right: 20px; align-content: center; }
  .desk-head > .ledger { grid-column: 1 / -1; grid-auto-columns: minmax(0, 1fr); margin: 8px 0 -8px; border-top: 1px solid var(--hair); }
  .desk-head > .ledger > div { padding: 10px 16px; box-shadow: inset 1px 0 var(--hair); }
  .desk-head > .ledger > div:first-child { box-shadow: none; }
}

/* Reading copy belongs to the book face; figures and controls stay in the UI face. */
main p.note, .slip p, .empty p, #preview p:not(#quote-fees, #fee, #quote-deadline, #quote-risk-note) {
  font-family: var(--prose); font-weight: 400; letter-spacing: normal; font-variant-numeric: normal;
}
#preview p:not(#quote-fees, #fee, #quote-deadline, #quote-risk-note) {
  font-size: 15px; line-height: 1.8; color: var(--sumi-2); max-width: 68ch;
}
#preview p + p { margin-top: 16px; }
#preview :is(#quote-fees, #fee) {
  font: 13px/1.9 var(--numbers); color: var(--sumi-2); padding-block: 12px;
  border-block: 1px solid var(--hair); white-space: pre-line;
}
.review-fee-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; white-space: normal; padding-block: 4px; }
.review-fee-row strong { font-weight: 500; white-space: nowrap; text-align: right; }
.review-fee-row small { grid-column: 1 / -1; font: 400 14px/1.7 var(--prose); color: var(--sumi-2); }
#preview #quote-deadline { font: 500 13px/1.7 var(--numbers); color: var(--shu-dk); }
@media (max-width: 560px) {
  #preview { margin-inline: 0; padding: 20px 16px; }
  .review-fee-row { column-gap: 10px; }
}

/* Closed help slips must not enlarge the page's scrollable area. */
.help:not([open]) > .slip { display: none; }
@media (max-width: 560px) {
  #preview::before { left: -6px; right: -6px; }
  #preview #confirm { padding-inline: 14px !important; letter-spacing: .02em !important; min-width: 0 !important; }
}

/* A persistent network label; the walkthrough is available without blocking the desk. */
.network-guide { width: min(100%, var(--frame)); margin: -8px 0 16px; padding: 0 14px; background: var(--washi-hi); border-left: 3px solid var(--shu); }
.network-guide > summary { font: 500 13px/1.6 var(--sans); }
.network-guide > p, .network-guide > ol { font: 400 15px/1.8 var(--prose); max-width: 72ch; }
.network-guide > a { display: inline-block; padding-block: 8px; font-size: 13px; }
.network-guide > ol { margin: 4px 0 14px; padding-left: 22px; }
.network-guide li + li { margin-top: 8px; }

.asset-unit { white-space: nowrap; }
#preview .asset-unit { gap: 4px; }
#preview .asset-unit::before { width: 14px; height: 14px; }

/* Transaction conditions read as a ledger, with exact figures separate from explanatory copy. */
#preview .review-facts { max-width: none; white-space: normal; }
.review-fact-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 4px 18px; padding-block: 10px; }
.review-fact-row + .review-fact-row { border-top: 1px solid var(--hair); }
.review-fact-row > span { font: 400 14px/1.7 var(--sans); color: var(--sumi-2); }
.review-fact-row > strong { font: 500 15px/1.7 var(--numbers); font-variant-numeric: tabular-nums; text-align: right; white-space: normal; overflow-wrap: anywhere; color: var(--sumi); }
.review-fact-row > small { grid-column: 1 / -1; font: 400 14px/1.7 var(--prose); color: var(--sumi-2); }
#preview #quote-risk-note { font: 400 13px/1.7 var(--sans); color: var(--muted); margin-top: 10px; max-width: 68ch; }
#preview #quote-risk-note:empty { display: none; }
#preview #quote-deadline { padding-top: 4px; }
@media (max-width: 560px) {
  .review-fact-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .review-fact-row > strong { text-align: left; }
}

#main-content .window > #notice.transaction-result { padding: 14px 48px 14px 16px; font: 400 14px/1.7 var(--prose); letter-spacing: normal; }
.transaction-result > strong { display: block; margin-bottom: 6px; font: 600 16px/1.6 var(--sans); color: var(--sumi); }
.transaction-result > span { display: block; }
.transaction-result > button { display: inline-block; margin-top: 10px; }
.transaction-result > a { display: inline-block; margin: 8px 12px 0 0; overflow-wrap: anywhere; }
#preview > :is(div#quote-detail, div#quote-exit) { margin-block: 16px; font: 400 15px/1.8 var(--prose); color: var(--sumi-2); }
#preview .review-exact { grid-column: 1 / -1; margin-top: 8px; }
#preview .review-exact > summary { font: 400 13px/1.7 var(--sans); color: var(--sumi-2); }
#preview .review-exact[open] > summary { margin-bottom: 8px; }

/* Ledger sync: real read stages, without a fabricated percentage. */
.ledger-sync { margin: 0 0 16px; padding: 18px 22px; border: 1px solid var(--line); border-left: 3px solid var(--shu); background: var(--washi-hi); color: var(--sumi); }
.sync-heading { display: flex; align-items: center; gap: 14px; }
.sync-seal { display: grid; place-items: center; flex: 0 0 64px; height: 64px; }
#sync-title { margin: 0; font: 600 17px/1.5 var(--serif); }
#sync-detail, #sync-slow, #sync-time { margin: 3px 0 0; font: 12px/1.6 var(--sans); color: var(--muted); }
#sync-time { margin-left: auto; white-space: nowrap; }
.sync-steps { display: flex; gap: 24px; margin: 14px 0 0 78px; padding: 0; list-style: none; font: 12px/1.5 var(--sans); }
.sync-steps li { border-bottom: 2px solid var(--hair); padding-bottom: 5px; color: var(--muted); }
.sync-steps li[data-state="active"], .sync-steps li[aria-current] { color: var(--shu-dk); border-color: var(--shu); }
.sync-steps li[data-state="done"] { color: var(--sumi); border-color: var(--sumi); }
.ledger-sync[data-phase="error"] .loading-mascot { opacity: .65; }
.ledger-sync:is([data-phase="connecting"],[data-phase="markets"],[data-phase="prices"]) .loading-mascot,
body[data-book="loading"] .portfolio-sync .loading-mascot { animation: clerk-checking 1.6s ease-in-out infinite; }
@keyframes clerk-checking { 25% { transform: translateY(-2px) rotate(-1deg); } 75% { transform: rotate(1deg); } }
.money-flow { margin: 0 0 18px; padding: 16px 20px; border: 1px solid var(--line); background: var(--washi-hi); }
.money-flow figcaption { margin-bottom: 12px; font: 600 14px/1.5 var(--serif); color: var(--shu-dk); }
@media (max-width: 560px) {
  .ledger-sync, .money-flow { padding: 14px 12px; }
  .sync-heading { flex-wrap: wrap; gap: 10px; }
  .sync-heading > div { flex: 1; }
  #sync-time { margin: 0 0 0 74px; }
  .sync-steps { margin-left: 0; gap: 12px; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) { .loading-mascot { animation: none !important; } }
/* A single ruled redemption slip: entries share a ledger, rather than separate cards. */
.money-flow.redemption-slip { position: relative; padding: 22px 26px 16px; background: var(--washi-tex) 0 0 / 480px, #f5eedc; border: 1px solid #b9a888; border-left: 7px double #9d442e; box-shadow: inset 0 0 0 5px #fff8, 0 3px 0 -1px #cabc9f; }
.redemption-slip figcaption { position: relative; display: grid; gap: 5px; padding: 0 62px 15px 0; margin: 0; border-bottom: 3px double #9d442e88; color: var(--sumi); }
.slip-kicker { font: 11px/1.5 var(--sans); letter-spacing: .08em; color: var(--muted); }
#redemption-slip-title { font: 600 25px/1.4 var(--serif); letter-spacing: .12em; }
.slip-mark { position: absolute; right: 2px; top: 0; padding: 4px 7px; border: 3px double var(--shu); color: var(--shu-dk); font: 600 18px/1.05 var(--serif); transform: rotate(-5deg); }
.slip-entries { display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 0; margin: 0; list-style: none; }
.slip-entries > li { position: relative; min-width: 0; padding: 20px 20px 22px; border-right: 1px solid #9d442e45; }
.slip-entries > li:first-child { padding-left: 0; }
.slip-entries > li:last-child { padding-right: 0; border-right: 0; }
.slip-entries > li:not(:last-child)::after { content: '→'; position: absolute; z-index: 1; right: -9px; top: 82px; padding: 3px 0; background: #f5eedc; color: var(--shu-dk); font-size: 18px; }
.entry-head { display: grid; grid-template-columns: 23px 1fr; gap: 3px 8px; align-items: center; }
.entry-number { grid-row: span 2; align-self: start; color: var(--shu-dk); border-bottom: 1px solid var(--shu); font: 600 20px/1.4 var(--serif); }
.entry-head h2 { margin: 0; font: 600 16px/1.5 var(--serif); color: var(--sumi); }
.entry-party { color: var(--muted); font: 11px/1.5 var(--sans); }
.entry-asset { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-height: 36px; margin: 14px 0 8px; border-bottom: 1px solid #9d442e45; padding-bottom: 8px; font: 600 18px/1.5 var(--serif); color: var(--sumi); }
.entry-asset small, .asset-or { font: 11px var(--sans); color: var(--muted); }
.entry-copy { margin: 0; color: var(--sumi-2); font: 13px/1.8 var(--prose); }
.slip-memo { display: flex; gap: 20px; padding-top: 12px; border-top: 3px double #9d442e88; }
.memo-label { flex: none; padding-top: 2px; color: var(--shu-dk); font: 600 12px/1.6 var(--serif); }
.slip-memo dl { margin: 0; flex: 1; font: 12px/1.8 var(--sans); }
.slip-memo dl > div { display: grid; grid-template-columns: 110px 1fr; column-gap: 12px; border-bottom: 1px dotted #9d442e45; padding: 3px 0; }
.slip-memo dt { color: var(--muted); } .slip-memo dd { margin: 0; color: var(--sumi-2); }
@media (max-width: 700px) {
 .money-flow.redemption-slip { padding: 18px 16px 14px; }
 .slip-entries { grid-template-columns: 1fr; }
 .slip-entries > li, .slip-entries > li:first-child, .slip-entries > li:last-child { padding: 15px 0 15px 35px; border-right: 0; border-bottom: 1px solid #9d442e45; }
 .entry-head { grid-template-columns: 1fr auto; }
 .entry-number { position: absolute; left: 0; top: 15px; }
 .entry-party { text-align: right; }
 .entry-asset { margin: 7px 0 3px; min-height: 0; border-bottom: 0; padding-bottom: 0; font-size: 17px; }
 .entry-copy { font-size: 12px; line-height: 1.7; }
 .slip-entries > li:not(:last-child)::after { content: '↓'; left: 4px; right: auto; top: auto; bottom: -12px; font-size: 16px; }
 .slip-entries > li:last-child { border-bottom: 0; }
 .slip-memo { display: block; }
 .slip-memo dl > div { grid-template-columns: 90px 1fr; }
}
.ledger-flow-title { font: 600 25px/1.4 var(--serif); letter-spacing: .08em; }
.savings-layout { display: grid; grid-template-columns: minmax(300px, 1.2fr) minmax(220px, 1fr); gap: 32px; align-items: center; }
.savings-map { display: block; width: 100%; max-width: 460px; margin: 12px auto 0; overflow: visible; }
.savings-map text { fill: var(--sumi-2); font: 13px var(--sans); }
.savings-map .map-title { fill: var(--sumi); font: 600 14px var(--serif); }
.savings-map .map-token { fill: var(--shu-dk); font: 600 13px var(--serif); }
.savings-map .map-small { font-size: 11px; }
.map-path { fill: none; stroke: #564e40; stroke-width: 1.25; }
.map-path.map-red { stroke: #a43f2d; }
.savings-notes h2 { margin: 0 0 12px; font: 600 15px/1.5 var(--serif); }
.savings-notes dl { margin: 0; }
.savings-notes dl > div { padding: 12px 0; border-top: 1px solid #9d442e45; }
.savings-notes dt { color: var(--shu-dk); font: 600 14px/1.6 var(--serif); }
.savings-notes dd { margin: 5px 0 0; font: 13px/1.8 var(--prose); color: var(--sumi-2); }
.savings-slip .slip-memo p { margin: 0; font: 12px/1.8 var(--sans); color: var(--sumi-2); }
@media (max-width: 700px) {
 .savings-layout { grid-template-columns: 1fr; gap: 0; }
 .savings-notes h2 { font-size: 14px; }
 .savings-notes dd { font-size: 12px; }
 .savings-notes dl > div { display: grid; grid-template-columns: 100px 1fr; gap: 12px; }
 .savings-notes dd { margin: 0; }
 .savings-notes dt { font-size: 12px; }
}
.lp-invitation { margin-top: 30px; padding: 24px 0 0; border-top: 3px double #a43f2d88; }
.lp-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.lp-heading h2 { font: 600 21px/1.5 var(--serif); margin: 4px 0 0; }
.lp-stamp { flex: none; padding: 5px 8px; font: 600 26px var(--serif); color: var(--shu-dk); border: 3px double var(--shu); transform: rotate(-4deg); }
.lp-invitation > p { font: 13px/1.8 var(--prose); color: var(--sumi-2); }
.lp-invitation > details { margin: 12px 0 0; border: 1px solid var(--field-rule); background: var(--washi-hi); }
.lp-invitation > details > summary { min-height: 52px; padding: 12px 40px 12px 14px; font: 600 14px/1.5 var(--serif); color: var(--sumi); }
.lp-invitation > details > summary::before { left: auto; right: 16px; width: 8px; height: 8px; }
.lp-disclosure-state { margin-left: auto; flex: none; color: var(--muted); font: 500 12px/1.5 var(--sans); }
.lp-invitation .when-open, .lp-invitation details[open] .when-closed { display: none; }
.lp-invitation details[open] .when-open { display: inline; }
.lp-invitation > details[open] > summary { border-bottom: 1px solid var(--hair); background: var(--washi-lo); }
.lp-invitation > details > .stage-form { padding: 16px 14px; }
.lp-invitation > details > summary:focus-visible { outline: 2px solid var(--shu); outline-offset: 3px; }
.lp-invitation > details > summary:active { background: var(--washi-lo); }
@media (hover: hover) and (pointer: fine) { .lp-invitation > details > summary:hover { background: var(--washi-lo); } }
.lp-invitation .lp-caution { margin-top: 20px; font: 12px/1.8 var(--sans); color: var(--muted); }
.lp-estimate { min-height: 2em; font: 13px/1.8 var(--sans); }
.lp-bond-link { display: inline-block; margin-top: 12px; font: 600 13px/1.8 var(--serif); }


:is(.unit,.u)[data-token="lp-jpydf-usdc"]::before { width: 30px; border-radius: 0; box-shadow: none; background: url(/assets/token-jpydf.svg) left center / 18px 18px no-repeat, url(/assets/token-usdc.webp) right center / 18px 18px no-repeat; }
:is(.unit,.u)[data-token="lp-kasane-jpydf"]::before { width: 30px; border-radius: 0; box-shadow: none; background: url(/assets/token-kasane.webp) left center / 18px 18px no-repeat, url(/assets/token-jpydf.svg) right center / 18px 18px no-repeat; }

.lp-review-fact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--hair); }
.lp-review-fact strong { text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

/* House actions: a small review seal, a clear label and a firm paper edge. */
button.primary:not(.sign-connect), button#confirm { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border-bottom-width: 3px; }
button.primary::before, button#confirm::before { content: "確" / ""; display: inline-grid; place-items: center; flex: none; position: static; width: 23px; height: 25px; background: none; border: 1px solid currentColor; font: 600 14px/1 var(--serif); color: inherit; transform: rotate(-3deg); }
button#confirm::before { content: "署" / ""; }
button.sign-connect::before, button.pb-connect::before { content: "帳" / ""; }
button.primary:disabled, button#confirm:disabled { color: #655c4c; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border-bottom-width: 3px; }
.desk-page:not(.reserve-page,.portfolio-page,.paper-page) .desk-title { background: var(--washi-hi); box-shadow: none; border-color: var(--line); }
.desk-page:not(.reserve-page,.portfolio-page,.paper-page) .desk-title::before { background: var(--book); width: 4px; border: 0; }
.tabbed::before, .desk-tabs::before { background: var(--sumi-2); height: 2px; box-shadow: none; }
.window-bar { background: var(--washi-lo); box-shadow: none; border-bottom-color: var(--line); letter-spacing: .04em; }
.window-bar::before { width: 4px; background: var(--book); }
.result::before, .result::after { display: none; }
main :is(.stage-line,.bond-lede,.order-lede,.desk-line) { font-family: var(--prose); }
.unit[data-token="dsol"]::before, .u[data-token="dsol"]::before { background-image: url(/assets/token-sol.webp); }
:is(.unit,.u)[data-token="lp-jpydf-usdc"]::before { width: 30px; border-radius: 0; box-shadow: none; background: url(/assets/token-jpydf.svg) left center / 18px 18px no-repeat, url(/assets/token-usdc.webp) right center / 18px 18px no-repeat; }
:is(.unit,.u)[data-token="lp-kasane-jpydf"]::before { width: 30px; border-radius: 0; box-shadow: none; background: url(/assets/token-kasane.webp) left center / 18px 18px no-repeat, url(/assets/token-jpydf.svg) right center / 18px 18px no-repeat; }
@media(max-width:1359px) {
 .desk-index a { color: var(--sumi-2); background: var(--washi-lo); border: 1px solid var(--hair); }
 .desk-index a[aria-current] { color: var(--shu-dk); background: var(--washi-hi); }
}
.unit[data-token="skasane"]::before, .u[data-token="skasane"]::before { background-image: url(/assets/token-kasane.webp); }
:is(.unit,.u)[data-token]:not([data-token="sol"],[data-token="dsol"],[data-token="usdc"],[data-token="jpydf"],[data-token="kasane"],[data-token="skasane"],[data-token="lp-jpydf-usdc"],[data-token="lp-kasane-jpydf"])::before { display: none; }
/* The disconnected asset ledger is already useful while scripts start. */
body.portfolio-page:not(.desk-closed):not([data-book="loading"]) #portfolio-empty:not([hidden]) { display: block; }
body.portfolio-page[data-book="loading"] #portfolio-empty { display: none; }
/* Sync phases exchange words inside the same reserved line box. */
#sync-detail { min-height: 3.6em; }
@media (max-width: 560px) {
  #sync-time { min-height: 1.5em; width: calc(100% - 74px); }
}
/* An amount travels with its token; the mark leads the number, never trails it. */
.asset-value { white-space: normal; }
.asset-value > .asset-icon { padding: 0; margin: 0 4px 0 0; font-size: 16px; line-height: 1; vertical-align: -2px; }
.asset-value > .asset-icon::before { margin: 0; }
.asset-value > .asset-unit { margin: 0; padding: 0; }
.amount > .unit[data-token]::before { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); margin: 0; width: 20px; height: 20px; }
.amount:has(> .unit[data-token]) > input { padding-left: 44px; }
:is(.desk-line,.stage-line):has(> .help) { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 12px; align-items: start; }
:is(.desk-line,.stage-line):has(> .help) > span { grid-column: 1; text-wrap: pretty; }
:is(.desk-line,.stage-line) > .help { grid-column: 2; grid-row: 1; margin: 0; }
.desk-line .help > summary { color: var(--muted); }
.field-head:has(> .help) { justify-content: flex-start; gap: 6px 8px; }
:lang(ja) :is(.desk-line,.note,.order-lede,.bond-lede,.stage-line,.pf-valuation,.slip p) { letter-spacing: normal; word-break: normal; line-break: strict; }
:lang(ja) .desk-line { word-break: auto-phrase; }

.amount > .unit[data-token^="lp-"]::before { width: 30px; }
.amount:has(> .unit[data-token^="lp-"]) > input { padding-left: 54px; }

.loading-mascot { display: block; object-fit: contain; transform-origin: 50% 85%; }
.portfolio-sync { display: none; }
body[data-book="loading"] .portfolio-sync { display: grid; justify-items: center; gap: 12px; padding: 28px 16px; background: var(--washi-hi); border: 1px solid var(--hair); }
.portfolio-sync p { margin: 0; font: 500 14px/1.7 var(--sans); }
/* Paper pages have an inset; exterior tabs must start outside the paper's border. */
@media (min-width: 1360px) { .paper-page .desk-index { margin-left: calc(-1 * var(--tab) - 37px); } }

/* Keep action anchors clear of the top edge when reached from another desk. */
#counter-actions { scroll-margin-top: 16px; }
.sub-panel > summary { min-height: 44px; }

/* Ledger figures retain every decimal; type hierarchy separates value from unit. */
.asset-digits { font-variant-numeric: tabular-nums lining-nums; white-space: normal; overflow-wrap: anywhere; }
.asset-fraction { font-weight: 400; color: var(--sumi-2); }
.review-fact-row > strong { font-size: 17px; line-height: 1.6; }
.review-fact-row .asset-unit { font: 500 12px/1.5 var(--sans); color: var(--muted); }
.review-fee-row > strong { font-size: 15px; }
#preview .review-exact > summary { min-height: 44px; border-block: 1px dotted var(--hair); color: var(--shu-dk); }
#preview #quote-deadline { color: var(--muted); font: 500 12px/1.7 var(--sans); font-variant-numeric: tabular-nums; }

/* A transaction receipt stays visible beside the desk without taking focus. */
.transaction-toast { position: fixed; z-index: 1400; right: 24px; bottom: 24px; width: min(390px, calc(100vw - 32px)); display: grid; grid-template-columns: 32px minmax(0,1fr) 36px; align-items: start; gap: 12px; padding: 18px; border: 1px solid var(--line); border-left: 4px double var(--shu); background: var(--washi-hi); box-shadow: 0 8px 24px #0003; }
.transaction-toast[hidden] { display: none; }
.tx-toast-seal { display: grid; place-items: center; width: 28px; height: 32px; border: 2px solid var(--shu); color: var(--shu); font: 600 19px/1 var(--serif); transform: rotate(-4deg); }
.tx-toast-content p { margin: 0; font: 500 14px/1.7 var(--sans); }
.tx-toast-content a { display: inline-block; margin-top: 6px; min-height: 32px; font: 13px/1.6 var(--sans); color: var(--shu-dk); }
.tx-toast-content a[hidden] { display: none; }
.tx-toast-close { width: 36px; min-height: 44px; margin: -6px -6px 0 0; padding: 0; border: 0; background: transparent; box-shadow: none; font: 24px/1 var(--sans); color: var(--muted); }
.transaction-toast[data-phase="complete"] { border-left-color: #344841; }
@media(max-width:560px) { .transaction-toast { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); } }
/* Devnet drip: a slip in the flow above the main column (it never covers a card), shown only to a wallet that looks unfunded. */
.drip { box-sizing: border-box; width: 100%; max-width: var(--frame); margin: 12px 0 0; display: grid; grid-template-columns: minmax(0,1fr) 32px; align-items: start; gap: 6px; padding: 10px 8px 10px 14px; border: 1px solid var(--line); border-left: 4px double var(--shu); background: var(--washi-hi); }
.drip-body { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 14px; row-gap: 2px; min-width: 0; }
.drip-said { flex-basis: 100%; }
.drip .drip-ask { justify-self: start; min-height: 32px; padding: 2px 0; color: var(--shu-dk); font: 600 14px/1.5 var(--serif); text-align: left; text-decoration: underline dotted 1px; text-underline-offset: 4px; word-break: auto-phrase; }
.drip .drip-ask:disabled { color: var(--muted); }
.drip-amounts { color: var(--muted); font: 500 12px/1.5 var(--sans); font-variant-numeric: tabular-nums; }
.drip-said { margin: 0; word-break: auto-phrase; font: 500 13px/1.6 var(--sans); color: var(--sumi); overflow-wrap: anywhere; }
.drip-said:empty, .drip [hidden] { display: none; }
.drip-said a { color: var(--shu-dk); white-space: nowrap; }
.drip[data-state="error"] .drip-said { color: var(--shu-dk); }
.drip-close { width: 32px; min-width: 0; min-height: 32px; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; font: 22px/1 var(--sans); color: var(--muted); }

/* Keep the dashboard's paper figures in place until its first real market read. */
body.dashboard-page:not([data-figures-ready]):not(.desk-closed) main > section.figures-window > #two-figures { display: grid !important; min-height: 180px; }
body.dashboard-page:not([data-figures-ready]):not(.desk-closed) #two-figures > div { display: grid !important; }
body.dashboard-page:not([data-figures-ready]) #two-figures::before { display: none; }
body.dashboard-page:not([data-figures-ready]) #two-figures dd.big { color: transparent; min-height: 36px; background: linear-gradient(90deg, #2a1c1214, #2a1c1207) left center / 80% 24px no-repeat; }
body.dashboard-page:not([data-figures-ready]) #two-figures .relation dd.big { min-width: 80px; }

/* Keep the current loan's collateral/debt subtraction visible beside the restored position metrics. */
.pf-parts { grid-area: 4 / 1 / 5 / 3; justify-self: end; display: grid; justify-items: end; font: 12px/1.6 var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .pf-parts { grid-area: 4 / 1; justify-self: start; justify-items: start; }
  .pf-line:has(.pf-parts) .pf-go { grid-area: 5 / 1; }
}

/* Conditions stay below their exact figures and use paragraphs within legacy paragraph hosts. */
.review-notes .review-paragraph { display: block; white-space: normal; }
.review-notes .review-paragraph + .review-paragraph { margin-top: 10px; }
.review-notes .review-facts { margin-top: 14px; }
.review-output { padding-block: 14px; border-top: 1px solid var(--hair); }
.review-output > h3 { margin: 0 0 8px; font: 600 16px/1.5 var(--serif); }

.pending-recovery { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hair); }
.pending-recovery > summary { min-height: 44px; cursor: pointer; font: 500 15px/1.6 var(--sans); }
.pending-recovery > p { font: 400 15px/1.8 var(--prose); }
.pending-recovery > a { display: block; margin-block: 12px; overflow-wrap: anywhere; }
.pending-recovery > button { max-width: 100%; white-space: normal; }

.lending-rate { margin-block:16px; }
.lending-rate .ledger { grid-template-columns:minmax(0,1fr); grid-auto-flow:row; background:var(--washi-hi); }
.lending-rate .ledger > div { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:baseline; gap:10px; padding:14px 18px; }
.lending-rate .ledger dd { font-size:24px; }
.lending-rate > p { margin:12px 18px; font:400 15px/1.8 var(--prose); }

/* Keep the last-read line in place while the first snapshot arrives. */
.lending-rate time, #credit-read-time { display:block; min-height:1.8em; font:500 12px/1.8 var(--sans); color:var(--sumi-2); }

/* APR is readable before connecting and occupies its space before the first read. */
.lending-page:not(.desk-closed) main > .lending-rate { display:block !important; }
.lending-rate #lending-apr-note { min-height:3.6em; }
.lending-rate .lending-history { margin:12px 18px; }
.lending-rate #supply-rate { margin-top:12px; }
@media(max-width:560px) { .lending-rate #lending-apr-note { min-height:5.4em; } }

/* Terms stay beside the operation; disclosures use the same ledger rules. */
.exit-notes { margin-top: 10px; color: var(--sumi-2); font-size: 13px; }
.exit-notes > summary { min-height: 44px; display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--shu); }
.exit-notes > summary::before { content: "＋"; }
.exit-notes[open] > summary::before { content: "−"; }
.exit-notes dl { margin: 4px 0 12px; border-top: 1px solid var(--line); }
.exit-notes dt { font-weight: 600; margin-top: 10px; }
.exit-notes dd { margin: 3px 0 0; line-height: 1.7; max-width: 65ch; }
.exit-notes > summary:focus-visible { outline: 2px solid var(--shu); outline-offset: 3px; }
.redemption-purpose { margin: 14px 20px 12px; padding-right: 44px; font-size: 13px; line-height: 1.6; }
.rate-detail-title { font-size: 18px; padding: 16px 20px 0; }
.management-desks > p, .management-desks > nav { margin: 14px 20px; }
.management-desks > nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 20px; }
.management-desks a { display: flex; align-items: center; min-height: 44px; font-size: 14px; }
@media(max-width: 899px) { .management-desks > nav { grid-template-columns: minmax(0, 1fr); } }

@media(max-width:899px) { .redeem-page .desk-body > .action-card { order: -1; } }

.portfolio-next > p, .portfolio-next > ul { margin: 14px 20px; }
.portfolio-next ul { list-style: none; padding: 0; }
.portfolio-next a { display: flex; align-items: center; min-height: 44px; }

.exit-notes > summary::before, .exit-notes[open] > summary::before { position: static; flex: none; width: auto; height: auto; margin: 0; border: 0; transform: none; }

/* Woven ledger trims. Motifs stay in their own bands, away from text and figures.
   Seigaiha remains the room background; the other patterns distinguish desks. */
:root { --pattern-ichimatsu: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%23645c4d%22%20fill-opacity%3D%22.14%22%20d%3D%22M0%200h12v12H0zM12%2012h12v12H12z%22%2F%3E%3C%2Fsvg%3E"); --pattern-asanoha: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2255.426%22%20height%3D%2296%22%20viewBox%3D%220%200%2055.426%2096%22%3E%3Cpath%20fill%3D%22none%22%20stroke%3D%22%23645c4d%22%20stroke-opacity%3D%22.23%22%20stroke-width%3D%221%22%20d%3D%22M27.713%2C0.000L55.426%2C16.000L55.426%2C48.000L27.713%2C64.000L0.000%2C48.000L0.000%2C16.000Z%20M27.713%2C32.000L27.713%2C0.000M36.951%2C16.000L27.713%2C32.000M36.951%2C16.000L27.713%2C0.000M36.951%2C16.000L55.426%2C16.000%20M27.713%2C32.000L55.426%2C16.000M46.188%2C32.000L27.713%2C32.000M46.188%2C32.000L55.426%2C16.000M46.188%2C32.000L55.426%2C48.000%20M27.713%2C32.000L55.426%2C48.000M36.951%2C48.000L27.713%2C32.000M36.951%2C48.000L55.426%2C48.000M36.951%2C48.000L27.713%2C64.000%20M27.713%2C32.000L27.713%2C64.000M18.475%2C48.000L27.713%2C32.000M18.475%2C48.000L27.713%2C64.000M18.475%2C48.000L0.000%2C48.000%20M27.713%2C32.000L0.000%2C48.000M9.238%2C32.000L27.713%2C32.000M9.238%2C32.000L0.000%2C48.000M9.238%2C32.000L0.000%2C16.000%20M27.713%2C32.000L0.000%2C16.000M18.475%2C16.000L27.713%2C32.000M18.475%2C16.000L0.000%2C16.000M18.475%2C16.000L27.713%2C0.000%20M0.000%2C48.000L27.713%2C64.000L27.713%2C96.000L0.000%2C112.000L-27.713%2C96.000L-27.713%2C64.000Z%20M0.000%2C80.000L0.000%2C48.000M9.238%2C64.000L0.000%2C80.000M9.238%2C64.000L0.000%2C48.000M9.238%2C64.000L27.713%2C64.000%20M0.000%2C80.000L27.713%2C64.000M18.475%2C80.000L0.000%2C80.000M18.475%2C80.000L27.713%2C64.000M18.475%2C80.000L27.713%2C96.000%20M0.000%2C80.000L27.713%2C96.000M9.238%2C96.000L0.000%2C80.000M9.238%2C96.000L27.713%2C96.000M9.238%2C96.000L0.000%2C112.000%20M0.000%2C80.000L0.000%2C112.000M-9.238%2C96.000L0.000%2C80.000M-9.238%2C96.000L0.000%2C112.000M-9.238%2C96.000L-27.713%2C96.000%20M0.000%2C80.000L-27.713%2C96.000M-18.475%2C80.000L0.000%2C80.000M-18.475%2C80.000L-27.713%2C96.000M-18.475%2C80.000L-27.713%2C64.000%20M0.000%2C80.000L-27.713%2C64.000M-9.238%2C64.000L0.000%2C80.000M-9.238%2C64.000L-27.713%2C64.000M-9.238%2C64.000L0.000%2C48.000%20M55.426%2C48.000L83.139%2C64.000L83.139%2C96.000L55.426%2C112.000L27.713%2C96.000L27.713%2C64.000Z%20M55.426%2C80.000L55.426%2C48.000M64.664%2C64.000L55.426%2C80.000M64.664%2C64.000L55.426%2C48.000M64.664%2C64.000L83.139%2C64.000%20M55.426%2C80.000L83.139%2C64.000M73.901%2C80.000L55.426%2C80.000M73.901%2C80.000L83.139%2C64.000M73.901%2C80.000L83.139%2C96.000%20M55.426%2C80.000L83.139%2C96.000M64.664%2C96.000L55.426%2C80.000M64.664%2C96.000L83.139%2C96.000M64.664%2C96.000L55.426%2C112.000%20M55.426%2C80.000L55.426%2C112.000M46.188%2C96.000L55.426%2C80.000M46.188%2C96.000L55.426%2C112.000M46.188%2C96.000L27.713%2C96.000%20M55.426%2C80.000L27.713%2C96.000M36.951%2C80.000L55.426%2C80.000M36.951%2C80.000L27.713%2C96.000M36.951%2C80.000L27.713%2C64.000%20M55.426%2C80.000L27.713%2C64.000M46.188%2C64.000L55.426%2C80.000M46.188%2C64.000L27.713%2C64.000M46.188%2C64.000L55.426%2C48.000%22%2F%3E%3C%2Fsvg%3E"); --pattern-kagome: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2248%22%20height%3D%2283.138%22%20viewBox%3D%220%200%2048%2083.138%22%3E%3Cpath%20fill%3D%22none%22%20stroke%3D%22%23645c4d%22%20stroke-opacity%3D%22.24%22%20stroke-width%3D%221%22%20d%3D%22M48.000%2C20.784L36.000%2C41.569L12.000%2C41.569L0.000%2C20.784L12.000%2C-0.001L36.000%2C-0.001Z%20M24.000%2C62.353L12.000%2C83.138L-12.000%2C83.138L-24.000%2C62.353L-12.000%2C41.568L12.000%2C41.568Z%20M72.000%2C62.353L60.000%2C83.138L36.000%2C83.138L24.000%2C62.353L36.000%2C41.568L60.000%2C41.568Z%22%2F%3E%3C%2Fsvg%3E"); --pattern-seigaiha: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2256%22%20height%3D%2228%22%20viewBox%3D%220%200%2056%2028%22%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22%23645c4d%22%20stroke-opacity%3D%22.23%22%3E%3Cpath%20d%3D%22M0%2028a28%2028%200%200%201%2056%200M8%2028a20%2020%200%200%201%2040%200M16%2028a12%2012%200%200%201%2024%200M-28%2014a28%2028%200%200%201%2056%200M28%2014a28%2028%200%200%201%2056%200M-20%2014a20%2020%200%200%201%2040%200M36%2014a20%2020%200%200%201%2040%200%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"); }
body { --desk-pattern: var(--pattern-ichimatsu); }
body:is(.earn-page,.reserve-page) { --desk-pattern: var(--pattern-asanoha); }
body:is(.health-page,.lending-page,.credit-page,.turbo-page,.perps-page) { --desk-pattern: var(--pattern-kagome); }
body:is(.home-page,.portfolio-page,.reports-page) { --desk-pattern: var(--pattern-seigaiha); }
.desk-head::after { content: ""; grid-column: 1 / -1; justify-self: end; width: min(100%, 180px); height: 8px; background: var(--desk-pattern) right center / auto 24px repeat; pointer-events: none; }
.site-foot::before { content: ""; display: block; height: 24px; margin-bottom: 10px; background: var(--desk-pattern) left center / auto 48px repeat; opacity: .65; filter: brightness(2.5); pointer-events: none; }
@media print { .desk-head::after, .site-foot::before { display: none; } }

/* One stable header across the Overview, monitoring and transaction desks. */
.product-nav { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.product-nav > *, .product-nav > a[href="/health.html"] { min-width: 0; }
.product-nav .menu-item { width: 100%; min-width: 0; flex-direction: column; justify-content: center; gap: 3px; padding-inline: 4px; font-size: 13px; letter-spacing: 0; }
.product-nav .menu-item > span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.product-nav summary.menu-item::before { display: none; }
@media (min-width: 1100px) {
  header { grid-template-columns: auto minmax(0, 1fr) 94px 164px; height: 56px; }
  header > .language-switch { grid-column: 3; }
  header > #connect, header > .preview-note { grid-column: 4; width: 164px; }
  .product-nav .book > summary.menu-item { padding-inline: 4px; }
}
@media (max-width: 1099px) {
  header { grid-template-columns: minmax(0, 1fr) 90px 144px; grid-template-rows: 44px 56px; height: auto; margin-top: 8px; }
  header > .brand { grid-column: 1; grid-row: 1; border-right: 0; }
  header > .language-switch { grid-column: 2; grid-row: 1; }
  header > #connect, header > .preview-note { grid-column: 3; grid-row: 1; width: 144px; }
  .product-nav { display: flex; grid-column: 1 / -1; grid-row: 2; border-top: 1px solid var(--hair); padding-inline: 2px; }
  .product-nav > *, .product-nav > a.menu-item { flex: 1 0 auto; min-width: 44px; }
  .product-nav > a.menu-item { width: auto; }
  .product-nav .menu-item { font-size: 12px; padding-inline: 2px; }
  .product-nav .book { position: static; }
  .book-panel { left: 6px; right: 6px; width: auto; translate: none; }
}
@media (max-width: 379px) {
  header { grid-template-columns: minmax(0, 1fr) 84px 140px; }
  header > #connect, header > .preview-note { width: 140px; }
  .product-nav .menu-item { font-size: 11px; padding-inline: 1px; }
}

/* Completed market reads stay a compact note; loading and failures retain
   their visible explanation. Never confuse a successful read with a fresh feed. */
.ledger-sync[data-read="ready"]:not([data-phase="error"]) { padding: 12px 18px; }
.ledger-sync[data-read="ready"]:not([data-phase="error"]) .sync-seal { width: 34px; height: 34px; flex: 0 0 34px; }
.ledger-sync[data-read="ready"]:not([data-phase="error"]) .sync-seal img { width: 34px; height: 34px; }
.ledger-sync[data-read="ready"]:not([data-phase="error"]) .sync-heading { align-items: center; gap: 12px; }
.ledger-sync[data-read="ready"]:not([data-phase="error"]) #sync-title { font-size: 15px; }
.ledger-sync[data-read="ready"]:not([data-phase="error"]) .sync-steps { display: none; }
.ledger-sync[data-read="ready"]:not([data-phase="error"]) #sync-time { white-space: normal; }
@media (max-width: 560px) {
  .ledger-sync[data-read="ready"]:not([data-phase="error"]) .sync-heading { flex-wrap: wrap; }
  .ledger-sync[data-read="ready"]:not([data-phase="error"]) .sync-heading > div { flex: 1; min-width: 0; }
  .ledger-sync[data-read="ready"]:not([data-phase="error"]) #sync-time { margin: 0 0 0 46px; width: calc(100% - 46px); min-height: 0; }
}
/* Read status stays visible when the technical market book is folded. */
.credit-page main > .credit-status { margin: -8px 0 8px; padding: 10px 14px; border: 1px solid var(--line); background: var(--washi-hi); }
.credit-page .credit-status p { margin: 0; }
.credit-page .credit-status #credit-read-time:empty { display: none; }

.credit-page .credit-status { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 4px 12px; align-items: center; }
.credit-page .credit-status > :is(p,time) { grid-column: 1; }
.credit-page .credit-status > button { grid-column: 2; grid-row: 1 / span 2; justify-self: end; }

.desk-read-note { margin: -8px 0 8px; padding: 7px 14px; border: 1px solid var(--line); background: var(--washi-hi); color: var(--sumi-2); font: 12px/1.7 var(--sans); display: flex; flex-wrap: wrap; gap: 4px 18px; }
.desk-read-note :is(a, button) { color: var(--shu-dk); }
/* "Try next": the Overview's strip for a connected wallet and the drip slip after it pays out; links sized to what the wallet holds. */
.try-next { padding: 14px 18px; }
.try-next[hidden] { display: none; }
.try-next h2 { font-size: 17px; }
.try-next-lede { margin: 2px 0 8px; color: var(--muted); font: 500 12.5px/1.6 var(--sans); }
.try-next-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 18px; margin: 0; padding: 0; list-style: none; }
.try-next-list li { display: grid; gap: 2px; padding: 8px 0; border-top: 1px dotted var(--line); }
.try-next-list a { min-height: 32px; display: inline-flex; align-items: center; font: 600 14px/1.4 var(--serif); color: var(--shu-dk); }
.try-next-list small { color: var(--muted); font: 500 12px/1.5 var(--sans); }
.drip .try-next-head { flex-basis: 100%; margin: 6px 0 0; font: 600 12px/1.4 var(--serif); letter-spacing: .06em; color: var(--shu-dk); }
.drip .try-next-list { flex-basis: 100%; }
.pf-dead .pf-name { text-decoration: line-through; text-decoration-color: var(--shu); }
.foot-note { margin: 6px 0 0; font: 11px/1.6 var(--sans); letter-spacing: .02em; color: var(--line); }
