:root { --stake-label-gap:4px; --stake-first-badge-gap:8px; --stake-badge-gap:6px; --stake-after-gap:12px; }
/* Shared page rhythm. Keep the existing Lineca/Switzer identity and dense data
   tables, while giving headings, forms and actions a consistent breathing space. */
:root { --page-gap:24px; --card-padding:24px; --section-gap:20px; }
.view { padding-bottom:64px; }
/* Validator public and personal epoch tables use the same page width. */
.view.vp { max-width:1240px; }
.mast { padding-top:32px; padding-bottom:4px; }
.mast-left { gap:12px; }

/* Actions that belong to the page's subject (copy its address, open its public page) sit beside the
   title but outside the <h1>, so the heading's accessible name stays the title alone. */
.mast-title { display:flex; flex-wrap:wrap; align-items:center; gap:10px 14px; min-width:0; }
.mast-title > h1 { margin:0; min-width:0; }
.mast-title-actions, .vp-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.vp-actions { justify-content:flex-end; }
.mast-title > .vp-actions { margin-inline-start:auto; }
/* The chips on the line under a page title or a validator's name: the Epoch chip, and on a validator its selection and Rank. */
.title-chips { display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px; }
.title-chips:empty { display:none; }
.mast .why { max-width:72ch; line-height:1.6; }
/* An empty (hidden) summary band must not erase the heading-to-content gap. */
.mast + .board,
.mast + .band:not(:has(*)) + .board { margin-top:var(--page-gap); }
.band { margin-block:20px 24px; padding-block:18px; }
.board { gap:var(--section-gap); }
.board > p, .board > [data-live-section] > p { margin-block:0; }  /* through a table's no-box section (task-20261114-121705) */
.board-kicker { margin:20px 0 12px; line-height:1.3; }
/* The kicker and heading rules also reach through a table's no-box section (task-20261114-121705, Explore). */
.board > .board-kicker, .board > [data-live-section] > .board-kicker { margin:20px 0 -8px; font:500 18px/1.3 var(--font-d); letter-spacing:-.015em; }
.board > .board-kicker:first-child, .board > [data-live-section]:first-child > .board-kicker:first-child { margin-top:0; }
.board > h2, .board > [data-live-section] > h2 { margin:12px 0 -8px; font:500 18px/1.3 var(--font-d); letter-spacing:-.015em; }
.board > h2:first-child, .board > [data-live-section]:first-child > h2:first-child { margin-top:0; }
.help { font-size:13px; line-height:1.6; }
/* Pending stake uses the same grouped flow in numeric tables, strips and Addresses. */
.stake-figure__note[data-pending-epoch] { display:inline-block; max-inline-size:100%; white-space:normal; font-family:var(--font-b); font-size:12px; color:var(--mute); }
.why { line-height:1.6; }
.sheet.pad > :first-child { margin-top:0; }
.sheet.pad > :last-child { margin-bottom:0; }
.sheet-head, .sheet.pad .sheet-head { margin-bottom:16px; line-height:1.4; }
.sheet.pad > h2 { margin:0 0 16px; }
.sheet.pad > :where(p, .why, .note, .mcard, .form, .field-row, .actions, .kv, .keycard, details) + :where(p, .form, .field-row, .actions, .kv, .keycard, details, .btn) { margin-top:16px; }
.sheet.pad > ul { margin-block:0; padding-left:20px; }
.sheet.pad > ul > li + li { margin-top:8px; }
.sheet.pad > ul > li { line-height:1.6; }
.form { gap:18px; }
.form > .help { margin:0; }
.form .field { gap:8px; }
.field > label, .field:not(.ex-bar .field) > span { font-size:13px; line-height:1.4; }
.field .help { margin:0; }
.form-foot { margin-top:6px; padding-top:20px; flex-wrap:wrap; }
.field-row, .actions { gap:12px; }
.checkline { align-items:flex-start; gap:10px; line-height:1.6; }
.checkline input { flex:none; margin-top:4px; }
/* Transaction review and account details use balanced label/value rows. */
.kv { gap:12px 24px; line-height:1.55; }
.kv dd { min-width:0; overflow-wrap:anywhere; }
/* Mixed facts and native controls share one row rhythm. Touch targets stay 44px; fine-pointer
   desktop facts use the inline control treatment instead of giving only money rows extra height. */
.kv--controls { align-items:center; }
.kv--controls > dd, .kv--controls > .transaction-review__fact-group > dd { display:flex; align-items:center; min-block-size:2.75rem; }
@media (min-width:561px) and (hover:hover) and (pointer:fine) {
  .kv--controls { align-items:baseline; }
  .kv--controls > dd, .kv--controls > .transaction-review__fact-group > dd { display:block; min-block-size:0; }
  .kv--controls > dd > .gen-balance, .kv--controls > .transaction-review__fact-group > dd > .gen-balance,
  .kv--controls .funds-fee-estimate > .gen-balance { vertical-align:baseline; }
  .kv--controls > dd > .gen-balance > summary, .kv--controls > .transaction-review__fact-group > dd > .gen-balance > summary,
  .kv--controls .funds-fee-estimate > .gen-balance > summary { min-block-size:0; padding-block:0; line-height:inherit; }
}
.vp-facts { display:grid; grid-template-columns:auto minmax(0,1fr); gap:8px 16px; margin:0; font-size:13px; }
.vp-facts:not(.kv--controls) { align-items:baseline; }
.vp-facts dt { color:var(--mute); }
.vp-facts dd { margin:0; min-width:0; overflow-wrap:anywhere; }
.transaction-review__fact-group { display:contents; }
.vp-facts:has(> .transaction-review__fact-group) { grid-template-columns:minmax(0,1fr) minmax(min-content,1fr); }
.keycard { margin-block:20px; }
.keycard .field-row, .sheet.pad .kv + .field-row { margin-top:20px; }
#exitReview, #withdrawalReview { margin-top:24px; padding-top:20px; border-top:1px solid var(--line); }
#exitReview > .board-kicker, #withdrawalReview > .board-kicker { margin-top:0; }
.sheet.pad > form.inline { display:block; margin-top:16px; }
.sheet.pad form > .table-scroll + .btn { margin-top:20px; }
.choice { gap:20px; }
.choice .c { gap:16px; }
.choice .c h2 { margin:0; font:500 24px/1.25 var(--font-d); letter-spacing:-.02em; }
.choice .c .btn { margin-top:auto; }
.choice .c .why { margin-bottom:4px; }
.account-navigation { gap:4px; margin-block:20px 24px; }
.account-table td { line-height:1.6; }
.account-actions { line-height:1.7; }
.account-actions a, .account-actions button { margin-block:4px; }
.notification-row { padding:24px; }
.notification-content p { margin-top:12px; }
/* Keep precision disclosures separate from both the values and wallet tools. */
.balance-overview + details { margin-top:12px; font-size:13px; line-height:1.6; }
.balance-overview + details > :not(summary) { margin-top:12px; }
.workspace-tools { padding-top:12px; line-height:1.6; }
.bstat i, .stats i { font-size:12px; line-height:1.5; margin-top:4px; }
/* Explorer uses the same section-heading scale. */
.chain-explorer h2 { font:500 22px/1.3 var(--font-d); letter-spacing:-.02em; }
/* Security and sign-in pages retain their narrower reading measure. */
.identity-page { margin-block:40px; }

.identity-page .kicker + h1 { margin-top:12px; }
.identity-page > p { margin-block:0 16px; }
.security-panel { margin-block:20px; }
.security-panel .form-actions { margin-bottom:0; }
.identity-page .identity-form { margin-top:20px; }
.auth-entry .form { margin-top:28px; }
.identity-page .form-actions { gap:12px; }
.identity-page .help, .auth-entry .help { font-size:13px; line-height:1.6; }
.identity-page form p { margin-block:16px; }
.identity-page .identity-back { margin-top:28px; padding-top:20px; }
@media (max-width:960px) {
  .view { padding-inline:24px; }
}
@media (max-width:760px) {
  .account-navigation { gap:0; }
  .account-navigation a { padding-inline:8px; }
}
@media (max-width:560px) {
  :root { --page-gap:24px; --card-padding:20px; --section-gap:18px; }
  .view { padding-inline:20px; padding-bottom:40px; }
  .mast { padding-top:24px; gap:20px; }
  .sheet-head { gap:10px; }
  .choice .c h2 { font-size:22px; }
  .kv { grid-template-columns:minmax(0,1fr); gap:6px; }
  .kv dd { margin-bottom:12px; }
  .kv dd:last-child { margin-bottom:0; }
  .account-navigation { gap:0; }
  .account-navigation a { padding-inline:12px; }
  .notification-row { padding:20px; }
  .identity-page { margin-block:24px; }
  /* Avoid iOS focus zoom and keep form text legible on narrow screens. */
  .field:not(.ex-bar .field) input, .field:not(.ex-bar .field) select,
  .field textarea { font-size:16px; }
}
/* Vesting separates its disclosure, progress bar and withdrawal action. */
.sheet.pad .bstats + details { margin-top:20px; font-size:13px; line-height:1.6; }
.vesting-progress { margin-block:20px; }
.sheet.pad > h2.board-kicker { margin:24px 0 12px; font:500 18px/1.3 var(--font-d); letter-spacing:-.015em; text-transform:none; color:var(--ink); }

/* The public header's network menu. */
.workspace-options { position:absolute; top:calc(100% + 6px); left:0; right:0; z-index:30; max-height:calc(100dvh - 170px); overflow-y:auto; padding:5px; background:var(--white); border:1px solid var(--line); border-radius:10px; box-shadow:0 8px 24px rgb(0 0 0 / .10); }
.workspace-list { max-height:160px; overflow-y:auto; }
.workspace-options a { display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:32px; padding:6px 9px; border-radius:5px; text-decoration:none; color:var(--ink); font:400 12px/1.5 var(--font-b); }
.workspace-list a > span:first-child { min-width:0; }
.workspace-list strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font:500 12px/1.5 var(--font-b); }
.workspace-list small { font-size:10px; }
.workspace-options a:hover, .workspace-options a[aria-current] { background:var(--fog); }
.workspace-check { flex:none; color:var(--ink); font-size:12px; }
.workspace-options p { margin:6px 9px; font:400 11px/1.5 var(--font-b); color:var(--mute); }
@media (max-width:960px) {
  .workspace-options a { min-height:40px; }
}

/* Refined workspace rows: clear names, one primary action, consistent targets. */
.workspace-name > strong, .workspace-name > .help { display:block; }
.workspace-name > .help { margin-top:4px; font-size:11px; color:var(--mute); overflow-wrap:anywhere; }
.workspace-actions { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.workspace-table .workspace-actions { gap:6px 16px; }
.workspace-table .workspace-actions a { margin:0; }
/* Multiline form controls follow the same surface, radius and focus treatment. */
.field textarea { width:100%; min-height:112px; padding:12px 13px; box-sizing:border-box; border:1px solid var(--line); border-radius:10px; background:var(--white); color:var(--ink); font:400 14px/1.6 var(--font-b); resize:vertical; }
@media (max-width:560px) {
  .workspace-table .workspace-actions { margin-top:8px; }
  .field textarea { font-size:16px; }
}

/* The menu animates in both directions; native details remains the no-JS fallback. */
.workspace-options a { transition:background-color 140ms var(--ease), color 140ms var(--ease); }

/* One left edge throughout the signed-in app, including identity and errors. */
.shell:not(.nosidebar) { --page-inset:32px; }
.shell:not(.nosidebar) > .maincol { padding:0; }
.shell:not(.nosidebar) .view { margin-inline:0; width:100%; padding-inline:var(--page-inset); }
.shell:not(.nosidebar) .maincol > :is(.identity-page, .error-page) {
  margin:0; padding:36px var(--page-inset) 64px; width:100%; max-width:704px;
}
.shell:not(.nosidebar) .identity-page .auth-entry { margin-inline:0; }
.identity-page > :is(.identity-page, .error-page) { margin:0; padding:0; max-width:none; }
.messages { margin:24px 32px 0; padding:0; list-style:none; max-width:960px; }
.messages li { margin:0 0 12px; }
.toastbox .tst { line-height:1.5; }
@media (max-width:960px) {
  .shell:not(.nosidebar) { --page-inset:24px; }
  .messages { margin-inline:24px; }
}
@media (max-width:560px) {
  .shell:not(.nosidebar) { --page-inset:20px; }
  .shell:not(.nosidebar) .maincol > :is(.identity-page, .error-page) { padding-top:24px; padding-bottom:40px; }
  .messages { margin-inline:20px; }
}

.live-read-status { display:flex; align-items:center; flex-wrap:wrap; gap:10px 16px; }
.live-read-status > p { margin:0; }

/* Opt-in rhythm for nested text, status, action and disclosure blocks. The stack owns its
   children's outer spacing; form-actions still owns spacing between the buttons themselves.
   Keep details as a native disclosure and put a stack inside its body when needed.
   Markup and hidden-state contract: docs/UI-PATTERNS.md. */
.content-stack { display:flex; flex-direction:column; gap:var(--section-gap); min-width:0; }
.content-stack > :not([hidden]) { margin-block:0; min-width:0; }
/* Nested money reviews separate preparation, facts, actions and status. */
.transaction-review { margin-top:var(--page-gap); }
.vp-review.content-stack > .vp-facts { margin-block:0; }
details > .content-stack { margin-block-start:var(--section-gap); }
.live-read-timestamp { min-width:0; overflow-wrap:anywhere; }
.live-read-timestamp:empty { display:none; }
/* Direct children are timestamp text and controls, so an unfilled timestamp and hidden actions
   do not leave an empty metadata row (and therefore an extra gap) in the stack. */
.content-stack > .live-read-status:not(:has(> :not([hidden]):not(:empty))) { display:none; }
.content-stack[hidden], .content-stack > [hidden],
.live-read-status[hidden], .live-read-status > [hidden] { display:none; }

.billing-preferences { display:grid; gap:16px; min-width:0; margin:8px 0 0; padding:20px 0 0; border:0; border-top:1px solid var(--line); }
.billing-preferences legend { padding:0 12px 0 0; font:600 15px/1.4 var(--font-b); }



/* A linked workspace wallet: its complete name wraps within the available width; its monospace address
   and copy stay on the line under it. */
.wallet-ref { display:inline-flex; flex-direction:column; align-items:flex-start; gap:2px; min-inline-size:0; max-inline-size:100%; vertical-align:top; }
.wallet-ref__line { display:inline-flex; align-items:center; gap:4px; min-inline-size:0; max-inline-size:100%; }
.wallet-ref__label { flex:none; white-space:nowrap; }
.wallet-ref__name { font-family:var(--font-b); min-inline-size:0; white-space:normal; overflow-wrap:break-word; }
.wallet-ref__address { font-family:var(--font-m); color:var(--mute); white-space:nowrap; }
/* A name placed directly above an existing address line. */
.wallet-ref__name--above { display:block; max-inline-size:100%; }
/* full=True (signing review): the whole address must stay visible, so it wraps inside its column instead of
   overflowing a phone; the copy button keeps its place beside it. */
.wallet-ref--full { display:flex; inline-size:100%; }
.wallet-ref--full .wallet-ref__line:last-child { align-items:flex-start; inline-size:100%; }
.wallet-ref__address--full { flex:0 1 auto; min-inline-size:0; white-space:normal; overflow-wrap:anywhere; }
.wallet-ref--full .copy-btn { flex:none; }
.wallet-ref-stack { display:flex; flex-direction:column; align-items:flex-start; gap:2px; max-inline-size:100%; }
/* One pending-figure treatment for tables, cards and headlines. */
.stake-figure__changes { display:flex; flex-direction:column; align-items:inherit; gap:var(--stake-badge-gap); max-inline-size:100%; font:400 12px/1.5 var(--font-b); color:var(--mute); white-space:normal; }
.stake-figure__badge { display:block; inline-size:fit-content; min-inline-size:min-content; max-inline-size:100%; padding:3px 8px; border:1px solid; border-radius:14px; font:400 12px/1.5 var(--font-b); white-space:normal; color:var(--ink); }
.stake-figure__amount-part { display:inline-flex; min-inline-size:max-content; align-items:baseline; gap:.25em; white-space:nowrap; }
.stake-figure__amount-part > .gen-balance { flex:0 0 auto; }
.stake-figure__epoch { white-space:nowrap; }
.stake-figure__badge--pending { border-color:color-mix(in srgb,var(--warn) 40%,var(--line)); background:color-mix(in srgb,var(--warn) 7%,var(--white)); }
.stake-figure__badge--pending .stake-figure__change-label, .stake-figure__pending-label { color:var(--warn); }
.stake-figure__badge--slash { border-color:color-mix(in srgb,var(--crit) 40%,var(--line)); background:color-mix(in srgb,var(--crit) 6%,var(--white)); }
.stake-figure__badge--slash .stake-figure__change-label { color:var(--crit); }
.stake-figure__change-label, .stake-figure__pending-label { font-weight:600; }
.stake-figure__explanation { max-inline-size:65ch; }
td.r .stake-figure__changes { align-items:flex-end; }
@media(max-width:560px) { td.r .stake-figure__changes { align-items:flex-start; } }

.stake-figure__pending-main { display:inline-block; }
.stake-figure__pending-main-epoch { font:400 12px/1.5 var(--font-b); color:var(--ink); }

/* Shared badge spacing: one component owns its caption, amount, badge stack and next text. */
.stake-figure { display:flow-root; min-inline-size:0; max-inline-size:100%; }
.stake-figure--inline { display:inline-block; vertical-align:baseline; }
.stake-figure__label { display:block; margin:0 0 var(--stake-label-gap); font:500 12px/1.4 var(--font-b); color:var(--mute); }
.stake-figure [data-stake-main] { margin-block:0; }
.stake-figure [data-stake-main] + .stake-figure__changes { margin-block-start:var(--stake-first-badge-gap); }
.stake-figure__after, .stake-figure + i { display:block; margin:var(--stake-after-gap) 0 0; font:400 12px/1.5 var(--font-b); color:var(--mute); }

/* A numbered money-change badge keeps its amount intact on the shared phone card tables. */
@media (max-width:640px) {
  table.data td[data-label]:has(> .stake-figure > [data-stake-changes]) { grid-column:1 / -1; }
}

/* Existing page captions and following text use the same shared spacing tokens as component slots. */
.vp-stat-label + .stake-figure { margin-block-start:var(--stake-label-gap); }
table.data td[data-label]:has(> .stake-figure)::before { min-block-size:0; margin-block-end:var(--stake-label-gap); }
.stake-figure:has([data-stake-changes]) + :is(.vp-stat-note,.vp-hold-note,i,.help) { margin-block-start:var(--stake-after-gap); }

/* One badge core: tables have two explicit lines; all other contexts stay one line. */
.badge-core .badge-lines, .badge-core .badge-lines > :is(span,div) { display:inline; }
.badge-core .stake-figure__amount-part { display:inline-flex; }
.badge-core .badge-timing { white-space:nowrap; }
.stake-figure__badge .badge-timing::before { content:" · "; }
table .badge-core .badge-lines > :is(span,div) { display:block; }
table .badge-core .stake-figure__amount-part { display:flex; }
table .stake-figure__badge .badge-timing::before { content:none; }
table .vp-chip.badge-core:has(.badge-timing) { height:auto; min-block-size:22px; padding-block:3px; line-height:1.35; align-items:flex-start; }
table .vp-chip.badge-core:has(.badge-timing)::before { margin-block-start:4px; }

/* Narrow metrics reuse the table chip's two lines. */
:is(.bstat, .vp-stat) .stake-figure { container:stake-metric / inline-size; }
@container stake-metric (max-width:224px) {
  .badge-core .badge-lines > :is(span,div) { display:block; }
  .badge-core .stake-figure__amount-part { display:flex; }
  .stake-figure__badge .badge-timing::before { content:none; }
}

/* Size a timed chip to its longest line, including the existing dot and padding. */
.vp-chip.badge-core:has(.badge-timing) { min-inline-size:max-content; }

/* Shared notice list keeps the existing 16px notice-to-content spacing. */
.attention-rows { margin-block-end:16px; }

/* Shared position withdrawal chips (signed 064000). */
.position-status { display:inline-flex; flex-direction:column; align-items:flex-start; gap:4px; min-inline-size:0; max-inline-size:100%; }
.vp-chip.badge-core.is-wrapped { min-inline-size:0; max-inline-size:100%; box-sizing:border-box; height:auto; min-block-size:22px; padding-block:3px; line-height:1.35; align-items:flex-start; white-space:normal; }
.vp-chip.badge-core.is-wrapped::before { margin-block-start:4px; flex:none; }
.vp-chip.badge-core.is-wrapped .badge-lines { display:block; min-inline-size:0; max-inline-size:100%; }
.vp-chip.badge-core.is-wrapped .badge-lines > :is(span,div) { display:block; white-space:normal; overflow-wrap:normal; word-break:normal; }
.vp-chip.badge-core.is-wrapped .badge-timing { white-space:normal; }
.vp-chip.badge-core.is-wrapped .badge-lines.is-flow { display:inline; }
.vp-chip.badge-core.is-wrapped .badge-lines.is-flow > :is(span,div) { display:inline; }
