/* Policy surfaces use the existing v4 typography, tokens and shell. */
[data-v31-root="policy"] { margin: 32px 0 48px; color: var(--ink); font: var(--fs-ui)/var(--lh-ui) var(--font-sans); overflow-wrap: anywhere; }
[data-v31-root="policy"] h2 { font: 500 var(--fs-heading)/1.4 var(--font-brand); letter-spacing: var(--ls-heading); overflow: visible; }
[data-v31-root="policy"] h3 { font: 600 17px/1.4 var(--font-sans); letter-spacing: -.01em; }
[data-v31-root="policy"] h4 { font: 600 var(--fs-body)/1.5 var(--font-sans); }
[data-v31-root="policy"] p { margin: 0; }
.vp-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 28px; }
.vp-eyebrow.v31-example { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 10px; padding: 2px 10px 2px 8px; border-radius: var(--r-pill); background: var(--accent-tint); color: var(--accent-ink); font-size: var(--fs-small); font-weight: 600; line-height: 1.5; }
.vp-eyebrow.v31-example::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.vp-heading h2 { margin-bottom: 8px; }
.vp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--ink-2); font-size: var(--fs-desc); }
.vp-private { flex: none; display: inline-flex; align-items: center; gap: 6px; background: var(--sunken); padding: 6px 12px; border-radius: var(--r-pill); color: var(--ink-2); font-size: var(--fs-small); font-weight: 500; }
.vp-layout { display: grid; gap: 24px; }
.vp-panel { min-width: 0; border: 1px solid var(--hairline); border-radius: var(--r-lg); background: var(--raised); padding: 28px; box-shadow: var(--e-1); }
.vp-panel > header { padding-bottom: 20px; }
.vp-panel > header h3 { margin-bottom: 4px; }
.vp-desc { color: var(--ink-2); font-size: var(--fs-desc); line-height: var(--lh-desc); }
.vp-note { margin-top: 16px !important; }
.vp-disclosure, .vp-question { background: var(--paper); padding: 16px 20px; border-left: 3px solid var(--accent); border-radius: 0 var(--r-md) var(--r-md) 0; margin-bottom: 24px !important; line-height: 1.6; }
.vp-question { font-size: var(--fs-body); }
.vp-facts { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 20px 24px; margin: 24px 0; }
.vp-facts--impact, .vp-facts--ledger { grid-template-columns: repeat(3,minmax(0,1fr)); }
.vp-fact { min-width: 0; }
.vp-fact--wide { grid-column: 1 / -1; }
.vp-fact--time dd { white-space: nowrap; }
.vp-fact dt { font-size: var(--fs-small); line-height: var(--lh-small); color: var(--ink-2); margin-bottom: 4px; }
.vp-fact dd { margin: 0; color: var(--ink); font-size: var(--fs-ui); line-height: 1.5; font-weight: 500; font-variant-numeric: tabular-nums; }
.vp-sub { display: block; margin-top: 6px; color: var(--ink-2); font-size: var(--fs-small); font-weight: 400; }
.vp-chips, .vp-meta { gap: 8px; }
.vp-chips { display: flex; flex-wrap: wrap; }
.vp-chip { display: inline-flex; align-items: center; min-height: 24px; padding: 1px 10px; border-radius: var(--r-pill); background: var(--sunken); color: var(--ink-2); font-size: var(--fs-small); line-height: 1.4; font-weight: 500; }
.vp-chip--id { font-family: var(--font-mono); font-size: var(--fs-mono); letter-spacing: .02em; }
.vp-chip--warn { background: var(--warning-tint); color: var(--warning); }
.vp-chip--accent { background: var(--accent-tint); color: var(--accent-ink); margin-left: 4px; }
.vp-pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 10px; border-radius: var(--r-pill); font-size: var(--fs-small); line-height: 1.5; font-weight: 600; text-transform: capitalize; background: var(--sunken); color: var(--ink-2); }
.vp-pill--granted { background: var(--success-tint); color: var(--success); }
.vp-pill--withdrawn { background: var(--warning-tint); color: var(--warning); }
.vp-pill--denied { background: var(--danger-tint); color: var(--danger); }
.vp-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.vp-row { display: flex; gap: 24px; align-items: flex-start; justify-content: space-between; border-top: 1px solid var(--hairline); padding: 20px 0; }
.vp-row--state { border-top: 0; padding-top: 0; }
.vp-row > div { min-width: 0; max-width: 64ch; }
.vp-row > button { flex-shrink: 0; }
.vp-label { font-weight: 600; }
.vp-state { margin: 8px 0 10px !important; }
.vp-boundary { border-top: 1px solid var(--hairline); padding-top: 16px; margin-top: 20px !important; color: var(--ink-2); font-size: var(--fs-desc); line-height: 1.6; }
.vp-check { display: flex; align-items: center; gap: 4px; min-height: 48px; cursor: pointer; font-size: var(--fs-ui); line-height: 1.5; padding: 4px 0; }
.vp-check input { appearance: none; width: 44px; height: 44px; margin: 0; flex: none; cursor: pointer; background: center / 24px 24px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='2' y='2' width='20' height='20' rx='4' fill='white' stroke='%2367635b' stroke-width='1.5'/%3E%3C/svg%3E"); }
.vp-check input:checked { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='2' y='2' width='20' height='20' rx='4' fill='%231c4f82'/%3E%3Cpath d='m6 12 4 4 8-9' fill='none' stroke='white' stroke-width='2'/%3E%3C/svg%3E"); }
.vp-check--box { margin-top: 12px; padding: 4px 16px 4px 4px; border: 1px solid var(--hairline-strong); border-radius: var(--r-md); background: var(--raised); }
.vp-check--box:hover { background: var(--hover-tint); }
.vp-check--box.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-tint); }
.vp-upload-list { padding: 0; margin: 0; list-style: none; }
.vp-upload-list li { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 0; border-top: 1px solid var(--hairline); }
.vp-upload-main { min-width: 0; flex: 1; }
.vp-upload-main b { font-weight: 600; word-break: break-all; }
.vp-upload-main .vp-meta { margin: 8px 0 6px; }
.vp-upload-check { flex: none; max-width: 235px; }
.vp-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 24px 0 4px; }
.vp-actions .btn { min-height: 44px; height: auto; white-space: normal; padding: 12px 16px; text-align: center; }
.vp-btn-danger { color: var(--danger); border-color: var(--danger-line); }
.vp-btn-danger:hover { color: var(--danger); background: var(--danger-tint); border-color: var(--danger); }
.vp-field { display: grid; gap: 8px; max-width: 520px; margin: 0 0 20px; font-weight: 500; }
.vp-field input, .vp-field select { min-height: 48px; width: 100%; padding: 12px; border: 1px solid var(--hairline-strong); border-radius: var(--r-md); background: var(--raised); font: 400 var(--fs-body)/1.5 var(--font-sans); color: var(--ink); }
.vp-field input:hover, .vp-field select:hover { border-color: var(--ink-4); }
.vp-check:focus-within, .vp-field input:focus-visible, .vp-field select:focus-visible, .vp-plan:focus-within { outline: var(--focus-outline); outline-offset: var(--focus-offset); }
.vp-plan-grid, .vp-effort-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.vp-plan { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--hairline-strong); border-radius: var(--r-md); cursor: pointer; min-width: 0; }
.vp-plan:hover { background: var(--hover-tint); }
.vp-plan:has(input:checked) { border-color: var(--accent-ink); background: var(--accent-tint); box-shadow: 0 0 0 1px var(--accent-ink); }
.vp-plan input { appearance: none; width: 44px; height: 44px; margin: 0; flex: none; background: radial-gradient(circle,transparent 9px,var(--ink-3) 9px,var(--ink-3) 10px,transparent 10px); }
.vp-plan input:checked { background: radial-gradient(circle,var(--accent-ink) 6px,transparent 6px,transparent 9px,var(--accent-ink) 9px,var(--accent-ink) 10px,transparent 10px); }
.vp-plan b, .vp-price { display: block; }
.vp-price { margin-top: 4px; font-size: var(--fs-heading); line-height: 1.4; font-weight: 600; font-variant-numeric: tabular-nums; }
.vp-price small { font: 400 var(--fs-small)/1.5 var(--font-sans); color: var(--ink-2); white-space: nowrap; }
.vp-effort { padding: 20px; border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--paper); min-width: 0; }
.vp-effort.is-selected { border-color: var(--accent-ink); background: var(--accent-tint); box-shadow: 0 0 0 1px var(--accent-ink); }
.vp-effort header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.vp-tag { display: none; padding: 1px 8px; border-radius: var(--r-pill); background: var(--accent-ink); color: #fff; font-size: var(--fs-small); font-weight: 600; white-space: nowrap; }
.vp-effort.is-selected .vp-tag { display: inline-flex; }
.vp-effort dl { margin: 0; }
.vp-spec { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-top: 1px solid var(--hairline); font-size: var(--fs-ui); }
.vp-spec dt { color: var(--ink-2); }
.vp-spec dd { margin: 0; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.vp-effort-grid + .vp-desc { margin-top: 16px; }
.vp-test { margin-top: 24px; padding: 20px; border-radius: var(--r-md); background: var(--paper); }
.vp-test .vp-field { max-width: 360px; margin-bottom: 12px; }
.vp-result { margin-top: 16px !important; padding: 12px 16px; border-radius: var(--r-md); background: var(--sunken); color: var(--ink-2); line-height: 1.5; }
.vp-result.is-ok { background: var(--success-tint); color: var(--success); }
.vp-result.is-short { background: var(--warning-tint); color: var(--warning); }
.vp-impact { margin: 0 0 4px; padding: 20px; border: 1px solid var(--warning-line); border-radius: var(--r-md); background: var(--warning-tint); }
.vp-impact-title { margin-bottom: 4px !important; }
.vp-impact .vp-facts { margin: 16px 0; }
.vp-empty { padding: 20px; border: 1px dashed var(--hairline-strong); border-radius: var(--r-md); background: var(--paper); color: var(--ink-2); }
.vp-danger-panel { border-color: var(--danger-line); }
.vp-deleted { margin-top: 20px; padding: 16px 20px; border-left: 3px solid var(--danger); border-radius: 0 var(--r-md) var(--r-md) 0; background: var(--danger-tint); }
.vp-deleted .btn { margin-top: 12px; }
.vp-status { color: var(--ink-2); line-height: 1.5; }
.vp-status.is-error { color: var(--danger); }
.vp-toast { position: sticky; bottom: 16px; z-index: 6; display: flex; align-items: flex-start; gap: 8px; margin: 20px 0 0; padding: 12px 8px 12px 20px; border: 1px solid var(--hairline-strong); border-radius: var(--r-md); background: var(--raised); box-shadow: var(--e-3); pointer-events: none; }
.vp-toast .vp-status { flex: 1; padding-top: 10px; padding-bottom: 10px; }
.vp-toast:has(.vp-status.is-error) { border-color: var(--danger-line); background: var(--danger-tint); }
.vp-toast:has(.vp-status:empty) { height: 0; margin: 0; padding: 0; border: 0; box-shadow: none; overflow: hidden; }
.vp-toast-x { pointer-events: auto; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: var(--r-md); background: transparent; color: var(--ink-2); cursor: pointer; }
.vp-toast-x:hover { background: var(--hover-tint-strong); color: var(--ink); }
.vp-toast-x:focus-visible { outline: var(--focus-outline); outline-offset: var(--focus-offset); }
.vp-status--inline { margin-top: 8px !important; }
.vp-status--inline:empty { display: none; }
.vp-status--inline.is-error { padding: 12px 16px; border-radius: var(--r-md); background: var(--danger-tint); }
.vp-dialog { position: fixed; margin: auto; width: min(640px,calc(100vw - 32px)); max-height: calc(100dvh - 48px); flex-direction: column; overflow: hidden; border: 1px solid var(--hairline-strong); border-radius: var(--r-xl); padding: 0; background: var(--raised); color: var(--ink); box-shadow: var(--e-4); }
.vp-dialog[open] { display: flex; }
.vp-dialog::backdrop { background: rgb(20 20 19 / .45); }
.vp-dialog h2 { padding: 28px 28px 8px; }
.vp-dialog-body { flex: 1; min-height: 0; overflow: auto; padding: 8px 28px 8px; }
.vp-dialog-body p + p, .vp-dialog-body .vp-impact + p { margin-top: 16px; }
.vp-dialog-body .vp-field { margin: 16px 0 8px; }
.vp-dialog-actions { flex: none; justify-content: flex-end; margin: 0; padding: 16px 28px 24px; border-top: 1px solid var(--hairline); background: var(--raised); }
.vp-dialog-actions .btn-ghost { margin-right: auto; }
.vp-details { border-top: 1px solid var(--hairline); padding-top: 4px; margin-top: 16px; }
.vp-details summary { display: list-item; min-height: 44px; padding: 10px 0; cursor: pointer; color: var(--accent-ink); font-weight: 500; }
.vp-details summary:focus-visible { outline: var(--focus-outline); outline-offset: var(--focus-offset); }
.vp-draft-details { border-top: 0; margin-top: 8px; }
.vp-draft-details > [data-details-content] > .vp-panel { margin-top: 8px; box-shadow: none; }
body.v31-policy-page .skip-link:not(:focus-visible) { transform: translateY(-100vh); }
.vp-unavailable { display: flex; gap: 16px; align-items: flex-start; padding: 24px; background: var(--raised); border: 1px solid var(--hairline-strong); border-radius: var(--r-lg); }
.vp-unavailable-icon { flex: none; display: inline-flex; margin-top: 4px; color: var(--warning); }
.vp-unavailable h2 { margin-bottom: 8px; }
.vp-unavailable p { margin: 0 0 16px; color: var(--ink-2); }
body[data-flow="checkout"].v31-policy-page #main { display: block; max-width: 1040px; }
body[data-flow="checkout"].v31-policy-page .tx-form { width: 100%; }
body[data-flow="checkout"].v31-policy-page .tx-form .focus-head { padding-bottom: 0; }
body[data-flow="checkout"].v31-policy-page .vp-toast { bottom: 24px; }
body[data-flow="signup"].v31-policy-page [data-v31-root="policy"] { margin: 0; }
body[data-flow="signup"].v31-policy-page .vp-panel { padding: 20px; border: 0; border-radius: var(--r-md); background: var(--sunken); box-shadow: none; }
body[data-flow="signup"].v31-policy-page .vp-panel > header { padding-bottom: 12px; }
body[data-flow="signup"].v31-policy-page .vp-panel > header h2 { font-size: 20px; margin-bottom: 4px; }
body[data-flow="signup"].v31-policy-page .vp-eyebrow.v31-example { background: var(--raised); }
body[data-flow="signup"].v31-policy-page .vp-disclosure { margin-bottom: 8px !important; background: var(--raised); }
body[data-flow="signup"].v31-policy-page .vp-facts { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 16px; margin: 16px 0; }
body[data-flow="signup"].v31-policy-page .vp-details { border-top-color: var(--hairline-strong); }
@media (max-width:900px) {
  .vp-plan-grid, .vp-effort-grid, .vp-facts--impact, .vp-facts--ledger { grid-template-columns: minmax(0,1fr); }
  .vp-facts--ledger { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width:640px) {
  [data-v31-root="policy"] { margin-top: 24px; margin-bottom: 32px; }
  .vp-heading { display: block; margin-bottom: 20px; }
  .vp-private { margin-top: 12px; }
  .vp-layout { gap: 16px; }
  .vp-panel { padding: 20px 16px; }
  .vp-panel > header { padding-bottom: 16px; }
  .vp-facts, .vp-facts--ledger, .vp-facts--impact { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px 16px; margin: 20px 0; }
  .vp-fact--time { grid-column: 1 / -1; }
  .vp-row, .vp-upload-list li { flex-direction: column; gap: 12px; align-items: stretch; }
  .vp-upload-check { max-width: none; border: 1px solid var(--hairline-strong); border-radius: var(--r-md); padding-right: 12px; }
  .vp-actions { align-items: stretch; flex-direction: column; margin-top: 20px; }
  .vp-actions .btn { width: 100%; }
  .vp-plan { padding: 12px 16px; }
  .vp-plan > span { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 12px; }
  .vp-price { margin: 0; }
  .vp-effort { padding: 16px; }
  .vp-test { padding: 16px; }
  .vp-impact { padding: 16px; }
  .vp-toast { bottom: 12px; padding-left: 16px; }
  body.app-body .vp-toast { bottom: calc(var(--bottomnav-h) + 12px + env(safe-area-inset-bottom)); }
  .vp-dialog { inset: auto 0 0 0; width: 100%; max-width: none; margin: 0; border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 92dvh; }
  .vp-dialog h2 { padding: 20px 20px 8px; }
  .vp-dialog-body { padding: 8px 20px; }
  .vp-dialog-actions { padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); justify-content: stretch; }
  .vp-dialog-actions .btn-ghost { margin-right: 0; }
  body[data-flow="signup"].v31-policy-page .vp-panel { padding: 16px; }
}

