:root{--bg:#FCFAF6;--brand:#633549;--ink:#383137;--card:#fff;--line:#B5A6AD;--muted:#685C63}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:18px/1.6 Arial,sans-serif}header,main{max-width:1150px;margin:auto;padding:24px}header{display:flex;justify-content:space-between;gap:16px;border-bottom:1px solid var(--line)}a{color:var(--brand)}h1{font-size:30px}h2{font-size:23px;margin:0 0 16px}label{display:block;margin:12px 0}input:not([type=checkbox]):not([type=radio]),select,textarea{width:100%;font:inherit;padding:10px;border:1px solid var(--line);border-radius:6px;background:white;color:var(--ink)}textarea{resize:vertical}input[type=checkbox]{width:21px;height:21px;accent-color:var(--brand)}.check{display:flex;align-items:center;gap:10px}.grid{display:grid;grid-template-columns:1fr 1fr;gap:24px}.panel{background:var(--card);padding:24px;border:1px solid var(--line);border-radius:12px;min-width:0}.person,.document{padding:12px 0;border-bottom:1px solid #e3dbe0}.person:last-child,.document:last-child{border-bottom:0}.person strong{display:block}.toolbar,.actions{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin:20px 0}.toolbar label{flex:1;min-width:200px}button{font:inherit;border-radius:6px;padding:10px 20px;cursor:pointer;border:1px solid var(--brand);background:var(--brand);color:white}.secondary{background:white;color:var(--brand)}button:disabled{opacity:.55;cursor:wait}fieldset{border:0;padding:0;margin:0;min-width:0}:focus-visible{outline:3px solid #E8AD48;outline-offset:3px}[hidden]{display:none!important}#message{min-height:29px}#message.error{color:#9C303D}small{color:var(--muted)}@media(max-width:800px){.grid{grid-template-columns:1fr}header,main{padding:16px}.panel{padding:18px}header{font-size:16px}}
dialog{width:min(440px,calc(100% - 32px));padding:28px;border:1px solid var(--line);border-radius:12px;background:var(--card);color:var(--ink)}dialog::backdrop{background:rgb(0 0 0 / 40%)}dialog .actions{margin-bottom:0}
/* V04 general-note component; existing IDs and privacy handlers are unchanged. */
@font-face{font-family:OwnerHeebo;src:url('assets/Heebo-Regular.ttf') format('truetype');font-weight:400;font-display:swap}
@font-face{font-family:OwnerHeebo;src:url('assets/Heebo-Bold.ttf') format('truetype');font-weight:700;font-display:swap}
.general-note{--selected:#FFF2D9;font-family:OwnerHeebo,Arial,sans-serif;display:flex;flex-direction:column;gap:16px;align-self:start}
.general-note h2{font:700 24px/34px OwnerHeebo,Arial,sans-serif;color:var(--brand);margin:0}
.general-note label{margin:0;font-size:15px;line-height:23px}
.general-note textarea{display:block;margin-top:8px;min-height:108px;font:400 18px/28px OwnerHeebo,Arial,sans-serif;padding:12px}
.general-note .check{min-height:48px;padding:12px;border:1px solid var(--line);border-radius:6px;font-size:18px;line-height:28px;cursor:pointer;overflow-wrap:anywhere}
.general-note .check:has(input:checked){background:var(--selected);border-color:var(--brand)}
.general-note .check input{flex:0 0 20px;width:20px;height:20px;margin:0}
.general-note #note-choices{display:grid;gap:8px}
.general-note:focus-within{scroll-margin-block:24px}

/* Sharing editor: scoped controls keep text-field styling out of radios. */
.sharing-page{max-width:740px;margin:auto;padding:24px;font:400 16px/1.5 OwnerHeebo,Arial,sans-serif;display:flex;flex-direction:column;gap:20px}
.sharing-page h1{font:700 26px/1.4 OwnerHeebo,Arial,sans-serif;color:var(--brand);margin:0}
.sharing-page h1:focus{outline:none}
.sharing-page>button{align-self:flex-start}
.sharing-page button{font:700 14px/24px OwnerHeebo,Arial,sans-serif;min-height:40px;padding:8px 16px;border-color:#754712;background:#E8AD48;color:#352735}
.sharing-page button.secondary{background:transparent;border-color:#B5A6AD;color:var(--brand)}
.sharing-page>button.secondary{border:0;padding:0;min-height:28px;font-weight:400}
.sharing-identity{display:none}
.sharing-page .sharing-group{padding:0;border:0;background:transparent;border-radius:0}
.sharing-page .sharing-legend{font-weight:700;font-size:17px;color:var(--brand);padding:0;margin-bottom:8px}
.sharing-options{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.sharing-page .sharing-choice{display:flex;align-items:center;gap:10px;min-height:46px;margin:0;padding:10px 14px;border:1px solid #E8DEE2;border-radius:8px;background:#fff;cursor:pointer}
.sharing-page .sharing-choice:has(input:checked){background:#F5EDEF;border-color:var(--brand)}
.sharing-page .sharing-choice:has(input:focus-visible){outline:2px solid #E8AD48;outline-offset:2px}
.owner-editor .sharing-page input[type=radio]{appearance:auto;accent-color:var(--brand);display:block;flex:0 0 18px;width:18px;min-width:18px;max-width:18px;height:18px;min-height:18px;max-height:18px;padding:0;margin:0;border:0}
.sharing-choice-text{min-width:0;overflow-wrap:anywhere}
.sharing-steps{grid-template-columns:1fr;gap:0;border:1px solid #E8DEE2;border-radius:10px;overflow:hidden}
.sharing-page .sharing-steps .sharing-choice{border:0;border-radius:0;min-height:48px;border-bottom:1px solid #E8DEE2}
.sharing-page .sharing-steps .sharing-choice:last-child{border-bottom:0}
.sharing-page .sharing-steps .sharing-choice:has(input:checked){box-shadow:inset -3px 0 var(--brand);font-weight:700}
.sharing-page .sharing-steps .sharing-choice:has(input:focus-visible){outline-offset:-3px}
.sharing-caption{font-size:13px;color:var(--muted);margin:8px 0 0}
.sharing-actions{display:flex;gap:10px;flex-wrap:wrap;padding-top:4px}
.sharing-edit{display:block;margin-top:12px}.person>small{display:block}
@media(max-width:600px){.sharing-page{padding:18px 16px;gap:18px}.sharing-page h1{font-size:23px}.sharing-options:not(.sharing-steps){grid-template-columns:1fr}.sharing-page .sharing-choice{padding:10px 12px}}

/* Lower levels are included, but only one radio is selected. */
.sharing-page .sharing-steps .sharing-choice.is-included{background:#F4EFEE;box-shadow:inset -3px 0 #C49AA9}
.sharing-page .sharing-steps .sharing-choice:has(input:checked){background:#E7D4DD;box-shadow:inset -4px 0 var(--brand)}

.sharing-item-name{margin:4px 0 0;color:var(--muted);font-size:16px}

.sharing-help{margin-top:10px;font-size:14px;line-height:1.65;color:var(--muted)}
.sharing-help summary{cursor:pointer;color:var(--brand);padding:8px 0;width:fit-content}
.sharing-help summary:focus-visible{outline:2px solid var(--brand);outline-offset:3px;border-radius:3px}
.sharing-help dl{margin:8px 0;padding-inline-start:12px;border-inline-start:2px solid #E8DEE2}
.sharing-help dt{font-weight:700;color:var(--brand);margin-top:10px}
.sharing-help dd{margin:2px 0 10px}
.sharing-help p{margin:8px 0}

.sensitive-warning{flex-basis:100%;width:100%;box-sizing:border-box;background:#fff8e8;border:1px solid #b78028;border-radius:8px;padding:14px;text-align:right}.sensitive-warning button{margin:4px;min-height:44px}.sensitive-warning button:focus-visible{outline:3px solid #e8ad48;outline-offset:2px}

.document-privacy-pending,.document-sharing-gaps{color:#633549;font-size:16px;line-height:1.6}.document-sharing-gaps a{display:inline-flex;align-items:center;min-height:44px;color:#633549;text-decoration:underline;margin-inline-start:12px}

/* SHARE-EDIT: scoped to the item confirmation; no shared shell changes. */
.share-edit-dialog{direction:rtl;text-align:right;box-sizing:border-box;width:min(580px,calc(100vw - 32px));max-height:85vh;overflow:auto;border:1px solid #d8bdc9;border-radius:16px;background:#fffaf7;color:#492c39;padding:24px;font-size:17px;line-height:1.65;overflow-wrap:anywhere}
.share-edit-dialog::backdrop{background:rgb(38 18 29 / 55%)}
.share-edit-dialog h2{font-size:24px;margin:0 0 16px}.share-edit-dialog h3{font-size:19px;margin:12px 0 4px}
.share-edit-dialog section{border-bottom:1px solid #e8dee2;padding-bottom:12px}.share-edit-dialog ul{padding-inline-start:24px}
.share-edit-dialog .actions{display:flex;gap:12px;flex-wrap:wrap}.share-edit-dialog button{min-height:44px;padding:10px 24px;border-radius:8px;cursor:pointer;font:inherit}
.share-edit-dialog .share-edit-confirm{background:#e8ad48;color:#392713;border:1px solid #ad741d}.share-edit-dialog .secondary{background:#fff;color:#633549;border:1px solid #b99aa8}
.share-edit-dialog button:focus-visible{outline:3px solid #633549;outline-offset:3px}

/* SHARE-UX document privacy control. */
#dialog-body .document-privacy-control{min-height:44px;font-weight:700;color:#633549;display:flex;align-items:center;gap:8px}
#dialog-body .document .actions{display:flex;flex-wrap:wrap;gap:12px}
#dialog-body .document .actions button:first-child{background:#fff;border:1px solid #633549;color:#633549;border-radius:8px;min-height:44px}

#dialog-body .document-primary button{background:#fff;border:1px solid #633549;color:#633549;border-radius:8px;min-height:44px}
#dialog-body .document-secondary{display:flex;gap:16px;margin-top:12px}
#dialog-body .document-secondary button{background:transparent;border:0;text-decoration:underline;padding:4px 0;min-height:44px}

.person-reassurance{background:#f5edef;color:#633549;border-inline-start:4px solid #633549;border-radius:8px;padding:12px 16px;font-size:16px;line-height:1.6;text-align:right;overflow-wrap:anywhere}

.sharing-page [hidden]{display:none!important}.sharing-page button,.sharing-page>button.secondary{min-height:44px}.sharing-summary,.sharing-required{color:#633549;line-height:1.6;margin:0;overflow-wrap:anywhere}.sharing-summary{padding:12px 16px;background:#f5edef;border-radius:8px}

.field-error{display:block;color:#9c303d;font-size:1rem;line-height:1.5;margin:4px 0 12px}[aria-invalid="true"]{border-color:#9c303d}
.brand{text-decoration:none;color:inherit}

.field-error[hidden]{display:none}

/* UX-W4A: saved choice and next step stay at the top of the choice page. */
.sharing-success{color:#383137;font-weight:700;margin:12px 0}
.sharing-connect{color:#383137;overflow-wrap:anywhere}
.sharing-connect a{display:inline-flex;align-items:center;min-height:44px;padding:8px 16px;border:1px solid #633549;border-radius:8px;color:#633549;text-decoration:none}
#sharing-section-title{scroll-margin-top:88px}

/* UX-W6 R2: preserve original handlers; both document actions are framed targets. */
:is(#documents,#dialog-body) .document-secondary button.document-file-action{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:44px;padding:8px 16px;font-size:16px;line-height:1.6;background:#fff;color:#633549;border:1px solid #633549;border-radius:8px;text-decoration:none}
:is(#documents,#dialog-body) .document-secondary button.document-file-action.danger{color:#9C303D;border-color:#9C303D;margin-inline-start:24px}

/* UX-W7 A4: override the later navigation filename flex rule only in real rows. */
body.owner-unified .doc-row .doc-name{display:block;min-width:0;overflow-wrap:anywhere;text-align:right}
@media(max-width:389px){body.owner-unified .doc-row{grid-template-columns:20px minmax(0,1fr);column-gap:6px;padding-inline:10px}body.owner-unified .doc-row>.doc-icon{width:20px}}
