/* Batch 5 (2026-10): every desk keeps its working area in the first screen. Explanations fold, repeated blocks leave, key figures
   grow. Loaded last on each page it serves, so it only overrides. */

/* Portfolio: a shorter cover, the totals in one row, and the folds side by side. */
.portfolio-page .desk-head { padding: 16px 28px 0 36px; }
.portfolio-page .pf-cover-label { margin: 0 0 4px; }
.portfolio-page .desk-head .desk-title { font-size: clamp(24px, 3vw, 30px); }
.portfolio-page .desk-head .desk-line { margin: 8px 0 12px; }
.portfolio-page:has(#portfolio-body:not([hidden])) .desk-head .desk-line { display: none; }
.portfolio-page:has(#portfolio-body:not([hidden])) .pf-cover-label { margin-bottom: 4px; }
.portfolio-page .pf-account { margin-top: 10px; padding: 6px 0; }
.portfolio-page .pf-scope { margin: 0; padding: 4px 0 10px; font-size: 12px; color: var(--muted); }
@media (min-width: 900px) {
  .portfolio-page .desk-head .ledger { grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); align-items: end; }
  .portfolio-page .desk-head .ledger > div:first-child { grid-column: auto; padding: 12px 0; border-bottom: 0; }
  .portfolio-page .desk-head .ledger > div:first-child dd { margin-top: 4px; font-size: 40px; line-height: 1.2; }
  .portfolio-page .desk-head .ledger > div { padding: 12px 16px 12px 0; }
  .portfolio-page .desk-head .ledger dd { font-size: 22px; font-weight: 600; }
}
.portfolio-page .pf-line { padding: 14px 4px; }
.portfolio-page .pf-amount .review-fact-row strong { font-weight: 600; font-size: 21px; }
.portfolio-page .pf-books .desk-stage { padding-block: 4px; }
.pf-folds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.pf-folds > details { margin: 0; }
.portfolio-page .pf-folds .pf-explanation { margin: 0; border: 1px solid #00000059; }
.portfolio-page .management-desks > summary { padding: 10px 16px; font: 13px/1.7 var(--sans); cursor: pointer; background: var(--washi-hi); }
.portfolio-page .management-desks > nav { margin: 4px 16px 10px; }
@media (max-width: 899px) { .pf-folds { grid-template-columns: minmax(0, 1fr); } }

/* KASANE desk: the head says one line (the tabs name the four actions; how it works stays behind its link), the figures stay large,
   and each tab opens straight on its form. */
.reserve-page .desk-head { padding: 18px 28px 0; }
.reserve-page .desk-head .desk-title { font-size: clamp(26px, 3vw, 34px); }
.reserve-page .desk-head .desk-line { max-width: none; margin: 6px 0 12px; font-size: 13.5px; line-height: 1.7; }
.reserve-page .desk-head .desk-line > .reserve-role { display: none; }
.reserve-page .desk-head .desk-line > .reserve-actions-intro > span { display: inline; }
.reserve-page .desk-head .ledger > div { padding: 12px 24px; }
.reserve-page .desk-head .ledger dd { margin-top: 2px; font-size: 26px; font-weight: 600; }
.reserve-page .desk-head #kasane-price { font-size: 34px; }
.reserve-page .reserve-order-heading { margin-bottom: 8px; }
.reserve-page .reserve-order-heading h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.reserve-page .reserve-order-heading p { font-size: 12.5px; }
@media (max-width: 560px) { .reserve-page .desk-head { padding: 14px 16px 0; } .reserve-page .desk-head .ledger > div { padding: 10px 0 10px 12px; } .reserve-page .desk-head .ledger dd { font-size: 20px; } .reserve-page .desk-head #kasane-price { font-size: 25px; } }
.reserve-page .desk-head .ledger { width: calc(100% + 56px); margin: 0 -28px; padding: 0 28px; }
.reserve-page .desk-head .desk-explainer { display: inline-block; margin: 0 0 0 6px; vertical-align: middle; }
.reserve-page .desk-head .desk-explainer > summary { min-height: 32px; }
.reserve-page .stage-form { gap: 12px; }
.reserve-page .receive { margin: 8px 0; padding: 10px 0; }
.reserve-page .receive strong { font-size: 28px; }
.reserve-page .action-card .actions { margin-top: 12px; }
.reserve-page .buy-guard { margin: 0 0 4px; }
@media (max-width: 560px) { .reserve-page .desk-head .ledger { width: calc(100% + 32px); margin: 0 -16px; padding: 0 16px; } }
.portfolio-page .pf-books { margin-top: 12px; }

/* Lend: the supply APR is the headline; utilization reads as a bar under its figure; the typed amount shows what it would earn. */
.lending-page .lend-board > div { align-content: start; }
.lending-page .lend-board .lend-apr dd { font-size: 30px; line-height: 1.2; color: var(--matcha); }
.lending-page .lend-board .lend-util dd { font-size: 20px; }
.lending-page .lend-board .lend-util dd::after { content: ""; display: block; width: 100%; max-width: 220px; height: 7px; margin-top: 6px; border: 1px solid var(--line); border-radius: 4px; background: linear-gradient(90deg, var(--kincha) var(--util, 0%), var(--washi-hi) var(--util, 0%)); }
@media (min-width: 900px) { .lending-page .lend-board { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); grid-auto-flow: row; } }
.lending-page .lend-estimate { margin: 4px 0 0; padding: 10px 12px; border: 1px solid var(--hair); border-left: 3px solid var(--matcha); background: var(--washi-hi); }
.lending-page .lend-estimate dd { font-size: 20px; font-weight: 600; color: var(--sumi); }
.lending-page .withdraw-notes, .lending-page .exit-notes { margin-top: 6px; }
.desk-folds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; margin-top: 12px; }
.desk-folds > details[open] { grid-column: 1 / -1; }
.desk-folds > details > summary { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 16px; cursor: pointer; font: 600 15px/1.45 var(--serif); list-style: none; }
.desk-folds > details > summary::-webkit-details-marker { display: none; }
.desk-folds > details > summary::before { content: "＋"; position: static; width: auto; height: auto; margin: 0; border: 0; transform: none; color: var(--shu); }
.desk-folds > details[open] > summary::before { content: "−"; }
.desk-folds .lending-rate { margin: 0; padding: 0; }
.desk-folds .lending-rate > summary h2 { margin: 0; font: inherit; }
.desk-folds .lending-rate > :not(summary) { margin-inline: 16px; }
.desk-folds .lending-rate[open] { padding-bottom: 12px; }
.desk-folds .flow-fold > #money-flow { margin: 0 12px 12px; }
@media (max-width: 899px) { .desk-folds { grid-template-columns: minmax(0, 1fr); } }
.desk-closed .desk-folds .lending-rate { display: none; }
.desk-folds .lending-rate > summary .rate-detail-title { margin: 0; padding: 0; font: inherit; }
body:is(.lending-page,.earn-page,.redeem-page) .flow-explanation-link { display: none; }
.desk-folds > details:only-child { grid-column: 1 / -1; }

/* JPYdf desks (Borrow, Earn, Redeem, Swap): the band's figures read at a glance. */
body:is(.borrow-page,.earn-page,.redeem-page,.fx-page) .desk-head .ledger > div { padding-block: 8px 10px; }
body:is(.borrow-page,.earn-page,.redeem-page,.fx-page) .desk-head .ledger dt { font-size: 11.5px; }
body:is(.borrow-page,.earn-page,.redeem-page,.fx-page) .desk-head .ledger dd { font-size: 23px; line-height: 1.3; }
@media (max-width: 560px) { body:is(.borrow-page,.earn-page,.redeem-page,.fx-page,.lending-page) .desk-head .ledger dd { font-size: 18px; } .lending-page .lend-board .lend-apr dd { font-size: 24px; } }

/* Dashboard and Reports (read-only paper pages): a shorter masthead so the two figures sit in the first screen. */
.paper-page .desk-head { margin-bottom: 12px; }
.paper-page .desk-head .desk-title { margin: 10px 0 4px; font-size: clamp(26px, 3vw, 34px); }
.dashboard-page.paper-page .desk-title { font-size: clamp(26px, 3vw, 34px); }
.paper-page .desk-title .desk-mark { width: 26px; height: 32px; font-size: 18px; }
.paper-page .paper-strap { margin: 0 0 6px; }
.dashboard-page.paper-page .ledger-sync { padding: 6px 0; }
.ledger-sync[data-read="ready"]:not([data-phase="error"]) { padding-block: 6px; }
.paper-page .figures-window .window-bar { padding-block: 6px; }
/* Once the read is done, the sync note shrinks to one quiet line (its title and the read time); the mascot and detail step aside. */
.dashboard-page .ledger-sync[data-phase="done"] .sync-seal, .dashboard-page .ledger-sync[data-phase="done"] #sync-detail { display: none; }
.dashboard-page .ledger-sync[data-phase="done"] .sync-heading { display: flex; align-items: baseline; gap: 12px; }
.dashboard-page .ledger-sync[data-phase="done"] #sync-title { font: 500 12.5px/1.6 var(--sans); color: var(--muted); }
.dashboard-page .ledger-sync[data-phase="done"] #sync-time { margin-left: auto; }
.dashboard-page.paper-page .paper-strap { display: none; }

/* Health: groups share rows by their card count (four columns at desktop width), so the page reads as one board. */
@media (min-width: 1200px) {
  .health-page .h-groups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: row dense; gap: 12px; margin-top: 12px; }
  .health-page .h-groups > .h-group { grid-column: span 4; margin-top: 0; }
  .health-page .h-groups > .h-group:has(.h-card:nth-child(3)):not(:has(.h-card:nth-child(4))) { grid-column: span 3; }
  .health-page .h-groups > .h-group:has(.h-card:nth-child(2)):not(:has(.h-card:nth-child(3))) { grid-column: span 2; }
  .health-page .h-groups > .h-group:has(.h-card):not(:has(.h-card:nth-child(2))) { grid-column: span 1; }
  .health-page .h-group .h-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; padding: 10px; }
  .health-page .h-card { padding: 12px 14px; gap: 6px; }
  .health-page .h-card .h-detail { font-size: 13px; line-height: 1.65; }
}

/* Tour: a shorter opening; at desktop width the three stops sit side by side, so their jump strip (kept on phones) steps aside. */
.tour-page .tour-intro { padding: 18px 24px; gap: 8px; }
.tour-page .tour-intro h1 { font-size: clamp(26px, 3vw, 34px); }
@media (min-width: 1100px) { .tour-page .tour-route { display: none; } }
