/* Every dialog, sheet and button menu shares these spacing values. Overlay
   backdrops keep their geometry; the visible inner panel gets the padding. */
:root{--pd-popup-padding:32px;--pd-popup-gap:20px;--pd-popup-close:12px}
html body :is(dialog,[role=dialog]:not(:has(>.ib-panel,>.ib-ask-panel)),[role=dialog]>.ib-panel,[role=dialog]>.ib-ask-panel){box-sizing:border-box;padding:var(--pd-popup-padding)!important;max-width:calc(100vw - 32px);gap:var(--pd-popup-gap)}
html body :is(dialog,[role=dialog]) :is(h1,h2,h3){margin-top:0;margin-bottom:16px}
/* The venture card's parts are measured against the company page (A31), so
   its own type keeps the company page's line height. */
html body :is(dialog,[role=dialog]) p:not(.vc-wide *){line-height:1.6}
html body :is(dialog,[role=dialog]) p+:is(p,form,textarea,ul){margin-top:16px}
html body :is(dialog,[role=dialog]) :is(.pd-save-prompt-actions,.pd-dialog__actions,.acts,.ib-goal-actions,.ib-ask-actions){display:flex!important;align-items:center!important;justify-content:flex-start;gap:16px!important;flex-wrap:wrap;margin-top:var(--pd-popup-gap)!important}
html body .pd-save-prompt{width:440px;max-width:calc(100vw - 32px);padding:var(--pd-popup-padding)!important}
html body .pd-save-prompt[data-show]{display:block!important}
html body .pd-save-prompt p{padding-right:32px!important;max-width:none}
html body .pd-save-prompt-actions{flex-wrap:nowrap!important}
html body .pd-save-prompt-actions>.pd-button{flex:0 1 auto;white-space:nowrap;padding-inline:20px}
html body .pd-save-signin{flex:none;display:inline-flex;align-items:center;min-height:44px}
html body :is(.pd-save-prompt-close,.pd-dialog__close){position:absolute;top:var(--pd-popup-close)!important;right:var(--pd-popup-close)!important;margin:0!important;width:44px;height:44px}
html body :is(.ib-dtop,.ib-ask-top){display:flex;align-items:center;gap:16px;margin-bottom:var(--pd-popup-gap)}
html body :is(.ib-dtop .ib-close,.ib-ask-top button){margin-left:auto;flex-shrink:0}
/* The venture dialog has its own scrolling body under a fixed header. */
html body #ib-dialog>.ib-panel.vc-wide{padding:0!important}
html body #ib-dialog .vc-wide>.ib-dtop{padding:20px var(--pd-popup-padding)!important;margin:0}
html body #ib-dialog .vc-wide>.ib-mbody{padding:var(--pd-popup-padding)!important}
html body :is([role=menu],.pd-menu,.pd-build-menu,.tt-menu,.ib-menu,.card-menu-panel,.card-save-menu>form){box-sizing:border-box;padding:12px!important;gap:8px}
html body :is([role=menu],.pd-menu,.pd-build-menu,.tt-menu,.ib-menu,.card-menu-panel,.card-save-menu>form)>:is(a,button){min-height:44px;padding:10px 12px}
@media(max-width:600px){:root{--pd-popup-padding:24px;--pd-popup-gap:20px;--pd-popup-close:8px}html body .pd-save-prompt-actions>.pd-button{padding-inline:16px;font-size:14px}html body .pd-save-prompt-actions{gap:16px!important}}

html body :is(dialog,[role=dialog]) :is(.pd-dialog__head,.ib-dtop,.ib-ask-top){display:flex;align-items:center;justify-content:space-between;gap:20px}
html body :is(dialog,[role=dialog]) p:has(>a.pd-button){display:flex;align-items:center;gap:16px;margin-top:var(--pd-popup-gap)}
html body :is(dialog,[role=dialog]):has(.pd-dialog__close)>:is(h2,h3){padding-right:44px}
/* Nested calendar popovers retain their day grid and use the same inset. */
html body :is(.dpop,.mcal-pop){padding:var(--pd-popup-padding)!important}
html body :is(dialog,[role=dialog]) :is([data-prompt-close],[data-report-close],[data-cookie-close],[data-corr-cancel][aria-label]){position:absolute;top:var(--pd-popup-close)!important;right:var(--pd-popup-close)!important;width:44px;height:44px;margin:0!important;padding:0}
html body :is(dialog,[role=dialog]) :is(.report-head,.pd-dialog__head){padding-right:44px;margin-bottom:var(--pd-popup-gap)}
html body :is(dialog,[role=dialog]) :is(.prompt-actions,.ib-actions){display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin-top:var(--pd-popup-gap)}
/* Founder Graph's inline research picker predates dialog semantics. */
html body .vc-pick{box-sizing:border-box;padding:var(--pd-popup-padding)!important}
html body .vc-pick-row{gap:16px}
html body .vc-pick-head{margin-block:var(--pd-popup-gap) 12px}

/* Graph-local styles have ID specificity. Keep these popup controls on the
   shared rhythm even when the board's original CSS is in a closer @scope. */
html body .ib-menu>.ib-mi{min-height:44px;padding:10px 12px}
html body #ib-dialog .vc-wide>.ib-dtop>.ib-close{position:absolute;top:var(--pd-popup-close);right:var(--pd-popup-close);margin:0}
html body #ib-dialog .vc-wide>.ib-dtop>.ib-dots{margin-right:80px}
html body #ib-dialog .vc-wide .vc-added{margin-top:16px}
html body #ib-dialog :is(.ib-editrow,.ib-share-go){display:flex;align-items:center;flex-wrap:wrap;gap:16px;margin-top:var(--pd-popup-gap)!important}
html body #ib-dialog :is(.ib-editrow,.ib-share-go)>:is(button,a){margin:0!important}
html body #ib-dialog :is(.ib-del,.ib-revbox,.ib-datesbox,#ib-about-in){margin-top:16px!important}
html body #ib-dialog .ib-del p{margin-bottom:0}
html body #ib-dialog .vc-pick-row{position:relative;gap:16px}
html body #ib-goal-dialog .ib-sub{margin-top:0}
/* With business goals the goal panel is a flex column whose rows carry their
   own margins. A panel gap stacks on every row and squeezed the five-goal
   list to nothing at 375x812, pushing Save out of the panel (SS-269). */
html body #ib-goal-dialog .ib-goal-panel{gap:normal}
html body #ib-ask-dialog .ib-ask-panel{position:relative}
html body #ib-ask-dialog .ib-ask-top{margin-bottom:16px}
html body #ib-ask-dialog .ib-ask-top>div{padding-right:76px}
html body #ib-ask-dialog .ib-ask-close{position:absolute;top:var(--pd-popup-close);right:var(--pd-popup-close);margin:0}
html body :is(#ib-dialog,#ib-ask-dialog) .ib-ask-sub{margin-top:16px}
html body :is(#ib-dialog,#ib-ask-dialog) .ib-ask-intents{gap:16px;flex-wrap:wrap;max-width:100%;box-sizing:border-box;margin-top:var(--pd-popup-gap)}
@media(max-width:600px){html body :is(#ib-dialog,#ib-ask-dialog) .ib-ask-intent{padding-inline:8px}}

/* Both cookie implementations use inline layout values. The Close wrapper
   must fit its existing text pill instead of squeezing it into a 44px box. */
html body #cookie-choices :is([data-cookie-actions],[data-referral-actions]){display:flex;align-items:center;gap:16px!important;margin-top:var(--pd-popup-gap)}
html body #cookie-choices p:has(+:is([data-cookie-actions],[data-referral-actions])){margin-bottom:0!important}
html body #cookie-choices [data-cookie-close]{width:auto;height:auto}
/* The compact dialog (no creator referrals) appends Close as its last action
   button. Give that pill the same corner as the full dialog's Close wrapper
   without changing the pinned consent script. */
html body #cookie-choices:not(:has(div[data-cookie-close])) [data-cookie-actions]>button:last-child{position:absolute;top:var(--pd-popup-close)!important;right:var(--pd-popup-close)!important;margin:0!important}
html body #cookie-choices>h2{padding-right:76px}

/* The report header's old -36px margin displaced the corner by 4px once
   shared padding became 32px. Keep its sticky band flush at either size. */
html body .revenue-report .report-head{top:calc(0px - var(--pd-popup-padding));margin:calc(0px - var(--pd-popup-padding)) calc(0px - var(--pd-popup-padding)) var(--pd-popup-gap)}
html body .depth-page.depth-page .cp-sheet .sub{margin-top:16px}
html body .pd-toast[data-prompt-action]{box-sizing:border-box;padding:var(--pd-popup-padding)}

/* Membership prompts always use this centred native dialog, including those
   opened from the existing phone action sheet. Keep the shared popup rhythm. */
html body dialog.pd-member-dialog{position:fixed;inset:0;margin:auto;width:520px;height:fit-content;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);padding:var(--pd-popup-padding)!important;border:1px solid var(--pd-line);border-radius:var(--pd-radius-card);background:var(--pd-surface-raised);color:var(--pd-ink);font:400 16px/1.6 var(--pd-font-body);box-shadow:var(--pd-shadow-dialog);overflow:auto;text-align:left}
html body dialog.pd-member-dialog::backdrop{background:rgb(20 33 59 / .35)}
html body dialog.pd-member-dialog>h2{padding-right:32px;margin:0 0 16px;font:var(--pd-weight-title) var(--pd-title-section)/var(--pd-leading-title) var(--pd-font-title);letter-spacing:var(--pd-tracking-title);text-wrap:balance}
html body dialog.pd-member-dialog>p{padding:0;margin:0;max-width:none;font:400 16px/1.6 var(--pd-font-body)}
html body dialog.pd-member-dialog>.pd-save-prompt-actions{margin-top:var(--pd-popup-gap)!important}
html body dialog.pd-member-dialog .pd-save-signin{color:var(--pd-muted);font:500 14px/1.4 var(--pd-font-body);text-decoration:none}
html body dialog.pd-member-dialog>.pd-dialog__close{display:grid;place-items:center;padding:0;border:0;background:transparent;color:var(--pd-muted);font:400 24px/1 var(--pd-font-body);cursor:pointer}

/* Connector items start hidden in prerendered pages; only session status reveals them. */
html body [data-claude-add][hidden]{display:none!important}
html body a[data-claude-add]{display:flex;align-items:center;gap:10px;text-decoration:none;color:inherit;white-space:nowrap}
html body a[data-claude-add] svg,.pd-build-menu button svg{width:18px;height:18px;flex:none}
html body .pd-build-menu :is(button,a[data-claude-add]){display:flex;align-items:center;gap:10px}
