/* Public trust flows and the personal account: sign-in, consent, invitations, device claim, recovery, resume; passkeys, recovery codes, sessions. Owned by the public-flows workstream. */

/* ---- The public card (board 06): one centred 420px card per page ---------------------------------- */
.pub { width: 100%; max-width: 420px; margin: 24px auto 48px; padding: 24px 24px 20px; background: var(--h4-surface); border: 1px solid var(--h4-border); border-radius: var(--h4-radius-dialog); box-shadow: var(--h4-shadow-menu); color: var(--h4-text); }
.pub.wide { max-width: 560px; }
.pub > * + * { margin-top: var(--h4-space-4); }
.pub-mark { display: flex; align-items: center; justify-content: space-between; gap: var(--h4-space-3); margin: 0 0 var(--h4-space-5); padding-bottom: var(--h4-space-3); border-bottom: 1px solid var(--h4-border); }
.pub-mark .wordmark { font-size: var(--h4-text-lg); font-weight: var(--h4-weight-bold); letter-spacing: -.01em; color: var(--h4-text); text-decoration: none; }
.pub-mark .host { display: inline-flex; align-items: center; gap: var(--h4-space-1); font-size: var(--h4-text-xs); color: var(--h4-text-muted); }
.pub-mark .host svg { width: 12px; height: 12px; }
.pub-title { margin: 0; font-size: var(--h4-text-2xl); line-height: var(--h4-leading-tight); font-weight: var(--h4-weight-bold); letter-spacing: -.02em; color: var(--h4-text); }
.pub-title + .pub-lead { margin-top: var(--h4-space-2); }
.pub-lead { margin: 0; color: var(--h4-text-muted); font-size: var(--h4-text-base); line-height: var(--h4-leading-normal); }
.pub-center { text-align: center; }
.pub-small { margin: 0; font-size: var(--h4-text-xs); color: var(--h4-text-muted); line-height: 1.5; }
.pub-foot { margin-top: var(--h4-space-5); padding-top: var(--h4-space-3); border-top: 1px solid var(--h4-border); font-size: var(--h4-text-xs); color: var(--h4-text-muted); text-align: center; line-height: 1.6; }
.pub-foot a { color: var(--h4-link); }
.pub-foot a + a { margin-left: var(--h4-space-2); }

/* Buttons: full width, 44px, primary blue or outline. */
.pub-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--h4-space-2); width: 100%; min-height: var(--h4-control-height); padding: 0 var(--h4-space-4); border: 1px solid var(--h4-border-control); border-radius: var(--h4-radius-control); background: var(--h4-surface); color: var(--h4-text); font: var(--h4-weight-semibold) var(--h4-text-base) var(--h4-font-sans); text-decoration: none; cursor: pointer; transition: background var(--h4-motion-fast) var(--h4-ease), border-color var(--h4-motion-fast) var(--h4-ease); }
.pub-btn:hover { background: var(--h4-surface-muted); }
.pub-btn.primary { background: var(--h4-primary); border-color: var(--h4-primary); color: var(--h4-primary-fg); }
.pub-btn.primary:hover { background: var(--h4-primary-hover); border-color: var(--h4-primary-hover); }
.pub-btn.danger { background: var(--h4-danger-action); border-color: var(--h4-danger-action); color: var(--h4-danger-action-fg); }
.pub-btn.quiet { border-color: transparent; color: var(--h4-link); }
.pub-btn:disabled { background: var(--h4-disabled-bg); border-color: var(--h4-disabled-bg); color: var(--h4-disabled-fg); cursor: default; }
.pub-btn:focus-visible, .pub input:focus-visible, .pub select:focus-visible, .pub summary:focus-visible { outline: 2px solid var(--h4-focus); outline-offset: 2px; }
.pub-btn svg { flex: none; }
.pub-btn .g { width: 18px; height: 18px; }
.pub-actions { display: grid; gap: var(--h4-space-2); }
.pub-actions.split { grid-template-columns: 1fr 1fr; }
.pub-actions form { display: contents; }
.pub-link { color: var(--h4-link); font-weight: var(--h4-weight-medium); }

/* Identity and fact rows: icon · label · value. */
.pub-rows { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--h4-border); }
.pub-rows > li { display: flex; align-items: center; gap: var(--h4-space-3); min-height: var(--h4-row-single); padding: var(--h4-space-2) 0; border-bottom: 1px solid var(--h4-border); font-size: var(--h4-text-sm); }
.pub-rows > li > svg { flex: none; color: var(--h4-text-muted); }
.pub-rows .k { color: var(--h4-text-secondary); }
.pub-rows .v { margin-left: auto; text-align: right; font-weight: var(--h4-weight-medium); overflow-wrap: anywhere; }
.pub-rows .v.dim { font-weight: var(--h4-weight-normal); }
.pub-rows select, .pub-rows input { min-height: 36px; padding: 4px 8px; font-size: var(--h4-text-sm); max-width: 220px; }
.pub-identity { display: flex; align-items: center; gap: var(--h4-space-3); padding: var(--h4-space-3) 0; border-top: 1px solid var(--h4-border); border-bottom: 1px solid var(--h4-border); text-decoration: none; color: inherit; }
.pub-identity .avatar { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--h4-radius-control); background: var(--h4-selected-bg); color: var(--h4-selected-fg); font-weight: var(--h4-weight-bold); font-size: var(--h4-text-sm); letter-spacing: .02em; }
.pub-identity .avatar.brand { background: var(--h4-primary); color: var(--h4-primary-fg); }
.pub-identity .who { display: grid; gap: 1px; min-width: 0; }
.pub-identity .who b { font-size: var(--h4-text-sm); font-weight: var(--h4-weight-semibold); display: inline-flex; align-items: center; gap: var(--h4-space-1); }
.pub-identity .who small { font-size: var(--h4-text-xs); color: var(--h4-text-muted); }
.pub-identity .who .ok { color: var(--h4-success-fg); }
.pub-identity > svg:last-child { margin-left: auto; color: var(--h4-text-muted); }
.pub-section { margin: 0; font-size: var(--h4-text-sm); font-weight: var(--h4-weight-semibold); color: var(--h4-text); }
.pub-section + * { margin-top: var(--h4-space-2); }

/* Chips and pills. */
.pub-chips { display: flex; flex-wrap: wrap; gap: var(--h4-space-2); margin: 0; padding: 0; list-style: none; }
.pub-chip { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: var(--h4-radius-pill); background: var(--h4-selected-bg); color: var(--h4-selected-fg); font: var(--h4-weight-semibold) var(--h4-text-xs) var(--h4-font-mono); }
.pub-pill { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: var(--h4-radius-pill); background: var(--h4-selected-bg); color: var(--h4-selected-fg); font-size: var(--h4-text-xs); font-weight: var(--h4-weight-semibold); white-space: nowrap; }
.pub-pill.active { background: var(--h4-status-active-bg); color: var(--h4-status-active-fg); }
.pub-pill.muted { background: var(--h4-status-offline-bg); color: var(--h4-status-offline-fg); }
.pub-pill.warn { background: var(--h4-status-expired-bg); color: var(--h4-status-expired-fg); }
.pub-scopes { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--h4-space-2); }
.pub-scopes li { display: grid; grid-template-columns: 20px 1fr; gap: var(--h4-space-3); align-items: start; font-size: var(--h4-text-sm); }
.pub-scopes svg { color: var(--h4-text-muted); margin-top: 2px; }
.pub-scopes b { display: block; font-weight: var(--h4-weight-semibold); }
.pub-scopes small { display: block; color: var(--h4-text-muted); font-size: var(--h4-text-xs); overflow-wrap: anywhere; }

/* Notes: warning, success, danger. */
.pub-note { display: flex; gap: var(--h4-space-2); align-items: flex-start; padding: var(--h4-space-3); border-radius: var(--h4-radius-control); font-size: var(--h4-text-sm); line-height: 1.45; }
.pub-note svg { flex: none; margin-top: 1px; }
.pub-note.warn { background: var(--h4-warning-bg); color: var(--h4-warning-fg); border: 1px solid color-mix(in srgb, var(--h4-warning-border) 40%, transparent); }
.pub-note.ok { background: var(--h4-success-bg); color: var(--h4-success-fg); border: 1px solid color-mix(in srgb, var(--h4-success-border) 40%, transparent); }
.pub-note.bad { background: var(--h4-danger-bg); color: var(--h4-danger-fg); border: 1px solid color-mix(in srgb, var(--h4-danger-border) 40%, transparent); }
.pub-note.info { background: var(--h4-surface-muted); color: var(--h4-text-secondary); border: 1px solid var(--h4-border); }
.pub-note b { font-weight: var(--h4-weight-semibold); }

/* Fields: label, control, inline error state. */
.pub-field { display: grid; gap: var(--h4-space-1); font-size: var(--h4-text-sm); font-weight: var(--h4-weight-semibold); }
.pub-field input, .pub-field select { width: 100%; min-height: var(--h4-control-height); font-size: var(--h4-text-base); font-weight: var(--h4-weight-normal); border: 1px solid var(--h4-border-control); border-radius: var(--h4-radius-control); background: var(--h4-surface); color: var(--h4-text); }
.pub-field.bad input { border-color: var(--h4-danger-border); box-shadow: 0 0 0 3px color-mix(in srgb, var(--h4-danger-border) 18%, transparent); background: var(--h4-danger-bg); }
.pub-field .hint { font-weight: var(--h4-weight-normal); color: var(--h4-text-muted); font-size: var(--h4-text-xs); }
.pub-err { display: flex; gap: var(--h4-space-2); align-items: flex-start; margin: 0; color: var(--h4-danger-fg); font-size: var(--h4-text-sm); font-weight: var(--h4-weight-medium); }
.pub-err:empty { display: none; }
.pub-err svg { flex: none; margin-top: 2px; }
.pub .err:empty { display: none; }
.pub .err { color: var(--h4-danger-fg); font-size: var(--h4-text-sm); margin: 0; }
.pub-code { font: var(--h4-weight-bold) var(--h4-text-3xl) var(--h4-font-mono); letter-spacing: .14em; text-align: center; text-transform: uppercase; padding: var(--h4-space-3); border-radius: var(--h4-radius-control); background: var(--h4-selected-bg); color: var(--h4-selected-fg); }
.pub-field input.pub-code { min-height: 64px; background: var(--h4-surface-muted); color: var(--h4-text); border-color: var(--h4-border); }
.pub-field input.pub-code::placeholder { color: var(--h4-text-muted); letter-spacing: .14em; }
.pub-field.bad input.pub-code { background: var(--h4-danger-bg); border-color: var(--h4-danger-border); }
.pub-stack { display: grid; gap: var(--h4-space-3); }

/* Big status glyph on the failure and recovery pages (board 11). */
.pub-glyph { width: 64px; height: 64px; margin: var(--h4-space-2) auto 0; display: grid; place-items: center; border-radius: var(--h4-radius-card); }
.pub-glyph svg { width: 32px; height: 32px; }
.pub-glyph.warn { background: var(--h4-warning-bg); color: var(--h4-warning-border); }
.pub-glyph.bad { background: var(--h4-danger-bg); color: var(--h4-danger-border); }
.pub-glyph.ok { background: var(--h4-success-bg); color: var(--h4-success-border); }
.pub-glyph.info { background: var(--h4-selected-bg); color: var(--h4-primary); }
.pub.centered .pub-title, .pub.centered .pub-lead { text-align: center; }

/* "New here?" and other fold-outs, and the naming dialog: details/summary (the CSP allows no inline scripts). */
.pub-more > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: var(--h4-space-2); min-height: var(--h4-control-height); padding: 0 var(--h4-space-1); font-size: var(--h4-text-sm); font-weight: var(--h4-weight-semibold); color: var(--h4-link); border-radius: var(--h4-radius-sm); }
.pub-more > summary::-webkit-details-marker { display: none; }
.pub-more > summary::after { content: "▾"; color: var(--h4-text-muted); font-size: var(--h4-text-xs); }
.pub-more[open] > summary::after { content: "▴"; }
.pub-more > .pub-stack { padding: var(--h4-space-3) 0 0; }

/* Codes list (board 07 panel 3). */
.pub-codes { margin: 0; padding: 0; list-style: none; border: 1px solid var(--h4-border); border-radius: var(--h4-radius-card); overflow: hidden; counter-reset: code; }
.pub-codes li { display: flex; align-items: center; gap: var(--h4-space-3); min-height: var(--h4-row-single); padding: 0 var(--h4-space-3); border-bottom: 1px solid var(--h4-border); font: var(--h4-weight-semibold) var(--h4-text-base) var(--h4-font-mono); letter-spacing: .06em; }
.pub-codes li:last-child { border-bottom: 0; }
.pub-codes li::before { counter-increment: code; content: counter(code); flex: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: var(--h4-radius-sm); background: var(--h4-surface-muted); color: var(--h4-text-muted); font: var(--h4-weight-semibold) var(--h4-text-xs) var(--h4-font-sans); letter-spacing: 0; }
.pub-codes code { background: none; padding: 0; font: inherit; }

/* The draft-resume banner js/connect.js prepends to <main>. */
body:not(.shell) > main > p.note:first-child, body:not(.shell) > main > p.note + p.note { max-width: 420px; margin: 16px auto 0; display: flex; flex-wrap: wrap; gap: var(--h4-space-2) var(--h4-space-3); align-items: center; font-size: var(--h4-text-sm); border-radius: var(--h4-radius-control); }
body:not(.shell) > main > p.note.ok { background: var(--h4-success-bg); color: var(--h4-success-fg); border-color: color-mix(in srgb, var(--h4-success-border) 40%, transparent); }
body:not(.shell) > main > p.note.bad { background: var(--h4-danger-bg); color: var(--h4-danger-fg); border-color: color-mix(in srgb, var(--h4-danger-border) 40%, transparent); }
body:not(.shell) > main > p.note a { font-weight: var(--h4-weight-semibold); color: var(--h4-link); }

/* The layout repeats the first error above <main>; a card that shows it inline hides that copy. */
body:not(.shell) > main > p.note.bad:has(+ .pub .pub-err) { display: none; }

/* Signed-out header: match the card on narrow screens. */
@media (max-width: 480px) {
    body:not(.shell) > main { padding: 12px 12px 48px; }
    .pub { margin-top: 8px; padding: 20px 18px 16px; border-radius: var(--h4-radius-card); }
    .pub-title { font-size: var(--h4-text-xl); }
    .pub-actions.split { grid-template-columns: 1fr; }
    .pub-code, .pub-field input.pub-code { font-size: var(--h4-text-2xl); }
}

/* ---- Step-up (board 08 panel 5): a modal-like card inside the shell ------------------------------- */
.stepup-wrap { display: grid; place-items: start center; padding: var(--h4-space-8) 0; }
.stepup { width: 100%; max-width: 440px; padding: var(--h4-space-5); background: var(--h4-surface-raised); border: 1px solid var(--h4-border); border-radius: var(--h4-radius-dialog); box-shadow: var(--h4-shadow-dialog); }
.stepup-head { display: flex; align-items: center; gap: var(--h4-space-3); margin: 0 0 var(--h4-space-2); }
.stepup-head svg { color: var(--h4-primary); flex: none; }
.stepup-head h1 { margin: 0; font-size: var(--h4-text-xl); font-weight: var(--h4-weight-bold); letter-spacing: -.01em; }
.stepup p { margin: 0 0 var(--h4-space-4); color: var(--h4-text-muted); font-size: var(--h4-text-sm); }
.stepup-action { display: flex; align-items: center; gap: var(--h4-space-3); padding: var(--h4-space-3); margin: 0 0 var(--h4-space-4); border-radius: var(--h4-radius-control); background: var(--h4-surface-muted); border: 1px solid var(--h4-border); font-size: var(--h4-text-sm); font-weight: var(--h4-weight-semibold); }
.stepup-action svg { color: var(--h4-text-muted); flex: none; }
.stepup-action small { display: block; font-weight: var(--h4-weight-normal); color: var(--h4-text-muted); font-size: var(--h4-text-xs); overflow-wrap: anywhere; }
.stepup .pub-actions { grid-template-columns: auto 1fr; }
.stepup .pub-actions .pub-btn:not(.primary) { width: auto; padding: 0 var(--h4-space-5); }

/* ---- Personal account (board 07): My account, tabs, overview cards, passkeys table --------------- */
.acct-head { margin: 0 0 var(--h4-space-4); }
.acct-head .eyebrow { display: block; font-size: var(--h4-text-sm); color: var(--h4-text-muted); }
.acct-head h1 { margin: 2px 0 0; font-size: var(--h4-text-2xl); font-weight: var(--h4-weight-bold); letter-spacing: -.02em; }
.acct-head .email { margin: 0; color: var(--h4-text-muted); font-size: var(--h4-text-sm); }
.acct-tabs { display: flex; gap: var(--h4-space-1); margin: var(--h4-space-4) 0 var(--h4-space-5); padding: 0; list-style: none; border-bottom: 1px solid var(--h4-border); overflow-x: auto; scrollbar-width: none; }
.acct-tabs li { flex: none; }
.acct-tabs a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--h4-space-3); margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--h4-text-secondary); font-size: var(--h4-text-sm); font-weight: var(--h4-weight-medium); text-decoration: none; white-space: nowrap; }
.acct-tabs a:hover { color: var(--h4-text); }
.acct-tabs a.on { color: var(--h4-primary); border-color: var(--h4-primary); font-weight: var(--h4-weight-semibold); }
.acct-banner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--h4-space-3) var(--h4-space-4); padding: var(--h4-space-4); margin: 0 0 var(--h4-space-4); border-radius: var(--h4-radius-card); background: var(--h4-selected-bg); color: var(--h4-selected-fg); }
.acct-banner .ic { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--h4-radius-control); background: var(--h4-surface); color: var(--h4-primary); }
.acct-banner b { display: block; font-size: var(--h4-text-base); }
.acct-banner small { display: block; font-size: var(--h4-text-sm); opacity: .85; }
.acct-banner .last { margin-left: auto; display: flex; align-items: center; gap: var(--h4-space-2); font-size: var(--h4-text-sm); padding-left: var(--h4-space-4); border-left: 1px solid color-mix(in srgb, currentColor 25%, transparent); }
.acct-banner .last span { display: block; }
.acct-banner .last small { font-size: var(--h4-text-xs); }
.acct-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--h4-space-4); align-items: start; }
.acct-card { padding: var(--h4-space-4); background: var(--h4-surface); border: 1px solid var(--h4-border); border-radius: var(--h4-radius-card); }
.acct-card-head { display: flex; align-items: flex-start; gap: var(--h4-space-3); margin: 0 0 var(--h4-space-3); }
.acct-card-head svg { flex: none; color: var(--h4-primary); margin-top: 2px; }
.acct-card-head h2 { margin: 0; font-size: var(--h4-text-base); font-weight: var(--h4-weight-semibold); }
.acct-card-head p { margin: 0; font-size: var(--h4-text-xs); color: var(--h4-text-muted); }
.acct-card-head .end { margin-left: auto; }
.acct-list { margin: 0; padding: 0; list-style: none; }
.acct-list li { display: flex; align-items: center; gap: var(--h4-space-3); min-height: var(--h4-row-touch-min); padding: var(--h4-space-2) 0; border-top: 1px solid var(--h4-border); font-size: var(--h4-text-sm); }
.acct-list li > svg:first-child { flex: none; color: var(--h4-text-muted); }
.acct-list .t { display: grid; gap: 1px; min-width: 0; }
.acct-list .t b { font-weight: var(--h4-weight-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-list .t small { color: var(--h4-text-muted); font-size: var(--h4-text-xs); }
.acct-list .end { margin-left: auto; display: inline-flex; align-items: center; gap: var(--h4-space-2); flex: none; }
.acct-list li.empty { color: var(--h4-text-muted); }
.acct-list a.row { color: inherit; text-decoration: none; display: contents; }
.acct-card .pub-btn { margin-top: var(--h4-space-3); }
.pub-btn.fit { width: auto; display: inline-flex; padding: 0 var(--h4-space-3); min-height: 36px; font-size: var(--h4-text-sm); margin-top: 0; }
.acct-danger { margin-top: var(--h4-space-4); }
.acct-danger .pub-btn { width: auto; border-color: var(--h4-danger-border); color: var(--h4-danger-fg); background: var(--h4-danger-bg); }
.acct-danger .pub-btn:hover { background: color-mix(in srgb, var(--h4-danger-bg) 70%, var(--h4-surface)); }
.acct-table { width: 100%; border-collapse: collapse; font-size: var(--h4-text-sm); }
.acct-table th { text-align: left; font-size: var(--h4-text-xs); font-weight: var(--h4-weight-semibold); color: var(--h4-text-muted); padding: var(--h4-space-2) var(--h4-space-2); background: var(--h4-surface-muted); border-bottom: 1px solid var(--h4-border); }
.acct-table td { padding: var(--h4-space-2) var(--h4-space-2); border-bottom: 1px solid var(--h4-border); vertical-align: middle; min-height: var(--h4-row-single); }
.acct-table td.name { display: flex; align-items: center; gap: var(--h4-space-2); font-weight: var(--h4-weight-semibold); }
.acct-table td.name svg { color: var(--h4-text-muted); flex: none; }
.acct-table td.menu { width: 44px; text-align: right; }
.acct-table .dim { color: var(--h4-text-muted); font-weight: var(--h4-weight-normal); }
.row-menu { position: relative; display: inline-block; }
.row-menu > summary { list-style: none; cursor: pointer; width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--h4-radius-sm); color: var(--h4-text-muted); font-weight: var(--h4-weight-bold); letter-spacing: .1em; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu > summary:hover { background: var(--h4-surface-muted); color: var(--h4-text); }
.row-menu > .menu { position: absolute; right: 0; top: 100%; z-index: var(--h4-z-popover); min-width: 180px; margin: 4px 0 0; padding: 6px; list-style: none; background: var(--h4-surface-raised); border: 1px solid var(--h4-border); border-radius: var(--h4-radius-card); box-shadow: var(--h4-shadow-menu); }
.row-menu .menu button, .row-menu .menu a { display: flex; align-items: center; gap: var(--h4-space-2); width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: var(--h4-radius-sm); background: none; color: var(--h4-text); font: inherit; font-size: var(--h4-text-sm); text-align: left; cursor: pointer; text-decoration: none; }
.row-menu .menu button:hover, .row-menu .menu a:hover { background: var(--h4-surface-muted); }
.row-menu .menu .danger { color: var(--h4-danger-fg); }
.pub-dialog { position: relative; display: inline-block; }
.pub-dialog > summary { list-style: none; cursor: pointer; }
.pub-dialog > summary::-webkit-details-marker { display: none; }
.pub-dialog > .panel { position: absolute; z-index: var(--h4-z-dialog); top: calc(100% + 8px); right: 0; bottom: auto; height: auto; display: block; animation: none; width: min(360px, calc(100vw - 32px)); padding: var(--h4-space-4); background: var(--h4-surface-raised); border: 1px solid var(--h4-border); border-radius: var(--h4-radius-card); box-shadow: var(--h4-shadow-dialog); text-align: left; }
.pub-dialog > .panel h3 { margin: 0 0 2px; font-size: var(--h4-text-base); font-weight: var(--h4-weight-semibold); color: var(--h4-text); }
.pub-dialog > .panel p { margin: 0 0 var(--h4-space-3); font-size: var(--h4-text-xs); color: var(--h4-text-muted); }
.pub-dialog > .panel .pub-btn { margin-top: 0; }
.pub-dialog > .panel .pub-actions { margin-top: var(--h4-space-3); grid-template-columns: 1fr 1fr; }
.pub-dialog.left > .panel { right: auto; left: 0; }
@media (max-width: 640px) {
    .acct-table thead { display: none; }
    .acct-table tr { display: grid; grid-template-columns: 1fr auto; gap: 0 var(--h4-space-2); padding: var(--h4-space-2) 0; border-bottom: 1px solid var(--h4-border); }
    .acct-table td { border: 0; padding: 2px 0; }
    .acct-table td.menu { grid-row: 1 / span 3; grid-column: 2; align-self: center; }
    .acct-table td[data-l]::before { content: attr(data-l) " "; color: var(--h4-text-muted); font-size: var(--h4-text-xs); }
    .acct-banner .last { margin-left: 0; padding-left: 0; border-left: 0; }
}

/* ===== Policy sheet (tree pages): the override form wraps on narrow screens instead of being clipped ===== */
.dir-wrap.policy { overflow-x: auto; }
.policy .override-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 0; }
.policy .override-form input { flex: 1 1 120px; min-width: 0; max-width: 100%; }
.policy details.override > summary { list-style: none; }
.policy details.override > summary::-webkit-details-marker { display: none; }
/* Demo sign-in card (local only). */
.pub-dev { margin: var(--h4-space-5) 0 var(--h4-space-3); padding: var(--h4-space-4); border: 1px dashed var(--h4-warning-fg); border-radius: var(--h4-radius-card); background: var(--h4-warning-bg); }
.pub-dev h2 { margin: 0 0 2px; font-size: var(--h4-text-base); display: flex; align-items: center; gap: var(--h4-space-2); }
.pub-dev-tag { font-size: 11px; font-weight: var(--h4-weight-semibold); letter-spacing: .04em; text-transform: uppercase; padding: 2px 6px; border-radius: 999px; background: var(--h4-warning-fg); color: var(--h4-surface); }
.pub-dev-lead, .pub-dev-foot { margin: 0 0 var(--h4-space-3); font-size: var(--h4-text-sm); color: var(--h4-text-secondary); }
.pub-dev-foot { margin: var(--h4-space-3) 0 0; }
.pub-dev .pub-identity.pub-dev-row { border: 1px solid var(--h4-border); border-radius: var(--h4-radius-control); background: var(--h4-surface); padding: var(--h4-space-2) var(--h4-space-3); text-decoration: none; color: inherit; }
.pub-dev .pub-identity.pub-dev-row:hover { background: var(--h4-surface-muted); }
.pub-dev .avatar { background: var(--h4-surface-muted); color: var(--h4-text); font-weight: var(--h4-weight-semibold); }
.card.narrow .pub-dev { text-align: left; }

.acct-card-head > details, .acct-card-head > .pub-btn.fit { margin-left: auto; flex: none; }
.acct-card-head summary.pub-btn, .acct-card-head .pub-btn.fit { white-space: nowrap; }
.acct-tabs { -webkit-overflow-scrolling: touch; mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }

/* Passkey fallback card (board 11): shown in place of the sign-in actions when the ceremony fails or is cancelled. */
.pub-fallback { display: grid; gap: var(--h4-space-3); }
.pub-fallback .pub-note div { display: grid; gap: 2px; }
