/* 相生 · 我的卡片（资料编辑）— 2026-11-06
   Loaded after friends-polish.css. Scoped to .pe-page (the #profile view) and #publish-dialog.
   Layout: short sections → grouped list rows (label · value · 谁能看到) like a dating-app profile editor.
   Colors come from friends-tokens.css; the form takes the owner's 五行 via data-element. */

html body .pe-page{max-width:680px;padding-top:20px}
html body .pe-page :is(h1,h2,summary){text-wrap:balance}
html body .pe-page :is(p,label,span,small,dd,a,button){text-wrap:pretty}
html body .pe-page .page-heading{align-items:flex-end;margin-bottom:12px}
html body .pe-page .page-heading h1{font:600 var(--xs-fs-2xl)/1.2 var(--xs-serif);color:var(--xs-ink);margin:0 0 4px;letter-spacing:1px}
html body .pe-page .page-heading p{font-size:var(--xs-fs-sm);color:var(--xs-muted);margin:0}
html body .pe-page .pe-poster-link{display:inline-flex;align-items:center;min-height:var(--xs-tap);padding:0 16px;border-radius:var(--xs-r-pill);font-size:var(--xs-fs-sm);font-weight:600;color:var(--xs-primary);border-color:var(--xs-line-strong);white-space:nowrap}

/* status strip */
html body .pe-page .pe-status{display:flex;align-items:center;gap:4px 14px;flex-wrap:nowrap;margin:0 0 14px;padding:0 14px;min-height:var(--xs-tap);border:0;border-radius:var(--xs-r-md);background:var(--xs-surface-2);font-size:var(--xs-fs-sm);color:var(--xs-ink-2)}
html body .pe-page .pe-status>span{margin-right:auto;white-space:nowrap}
html body .pe-page .pe-status .status-dot{background:var(--xs-wood)}
html body .pe-page .pe-status .text-button,html body .pe-page .pe-status>a{margin:0;width:auto;font-size:var(--xs-fs-sm);color:var(--xs-primary);min-height:var(--xs-tap);display:inline-flex;align-items:center;white-space:nowrap}

/* form = stack of cards */
html body .pe-page .pe-layout{display:block}
html body .pe-page .pe-form{background:none;border:0;padding:0;display:grid;gap:12px}
html body .pe-page .pe-form .notice{margin:0;font-size:var(--xs-fs-sm);color:var(--xs-ink-2);background:var(--xs-primary-soft);border-left:3px solid var(--xs-el);border-radius:var(--xs-r-sm)}
html body .pe-page .pe-sec{background:var(--xs-surface);border:1px solid var(--xs-line);border-radius:var(--xs-r-lg);padding:6px 16px 12px;margin:0}
html body .pe-page .pe-h{display:flex;align-items:center;gap:8px;font:600 var(--xs-fs-md)/1.3 var(--xs-serif);color:var(--xs-ink);margin:10px 0 2px;letter-spacing:.5px}
html body .pe-page .pe-h::before{content:"";width:4px;height:16px;border-radius:2px;background:var(--xs-el);flex:none}
html body .pe-page .pe-opt{font-style:normal;font-weight:400;font-family:var(--xs-sans);font-size:var(--xs-fs-xs);color:var(--xs-muted);margin-left:6px;white-space:nowrap}
html body .pe-page .pe-req{font-style:normal;color:var(--xs-fire);margin-left:2px}
html body .pe-page .pe-note,html body .pe-page .fine-print{font-size:var(--xs-fs-sm);line-height:1.6;color:var(--xs-muted);margin:6px 0}

/* list rows: label · value · scope */
html body .pe-page .pe-list>.pe-row{display:grid;grid-template-columns:4.6em minmax(0,1fr) auto;align-items:center;gap:10px;min-height:52px;border-top:1px solid var(--xs-line)}
html body .pe-page .pe-list>.pe-row:first-child{border-top:0}
html body .pe-page .pe-h+.pe-list>.pe-row:first-child,html body .pe-page summary+.pe-note+.pe-list>.pe-row:first-child{border-top:0}
html body .pe-page .pe-k{display:flex;flex-direction:column;align-items:flex-start;font-size:var(--xs-fs-base);color:var(--xs-ink-2);margin:0;line-height:1.25}
html body .pe-page .pe-k .pe-opt{margin:2px 0 0}
html body .pe-page .pe-k:has(.pe-req){flex-direction:row}
html body .pe-page .pe-v{display:flex;align-items:center;gap:6px;min-width:0}
html body .pe-page .pe-v :is(input,select){flex:1;min-width:0;width:100%;min-height:var(--xs-tap);margin:0;padding:0 10px;border:1px solid transparent;border-radius:var(--xs-r-md);background:var(--xs-surface-2);font-size:var(--xs-fs-base);color:var(--xs-ink)}
html body .pe-page .pe-v :is(input,select):focus{border-color:var(--xs-focus);background:var(--xs-surface)}
html body .pe-page :is(.pe-v input,.pe-block textarea)::placeholder{color:var(--xs-muted)}
html body .pe-page .pe-v select{appearance:none;-webkit-appearance:none;padding-right:26px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%235d665e' stroke-width='1.5'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 8px center;background-size:12px;text-overflow:ellipsis}
html body .pe-page .pe-static{font-size:var(--xs-fs-base);color:var(--xs-ink);font-weight:600;padding-left:2px}
html body .pe-page .pe-unit{font-size:var(--xs-fs-sm);color:var(--xs-muted);flex:none}

/* who-can-see pill: a real <select> (44px hit area), painted as a small pill */
html body .pe-page .pe-scope{position:relative;display:inline-flex;align-items:center;flex:none;--sc:var(--xs-primary);--sc-bg:var(--xs-primary-soft)}
html body .pe-page .pe-scope[data-v="connected"]{--sc:#77510f;--sc-bg:var(--xs-earth-soft)}
html body .pe-page .pe-scope[data-v="private"]{--sc:var(--xs-metal);--sc-bg:var(--xs-surface-2)}
html body .pe-page .pe-scope::before{content:"";position:absolute;left:0;right:0;top:8px;bottom:8px;border-radius:var(--xs-r-pill);background:var(--sc-bg);border:1px solid color-mix(in srgb,var(--sc) 35%,transparent);pointer-events:none}
html body .pe-page .pe-scope select.scope{position:relative;appearance:none;-webkit-appearance:none;width:auto;min-width:0;min-height:var(--xs-tap);height:var(--xs-tap);margin:0;padding:0 24px 0 12px;border:0;border-radius:var(--xs-r-pill);background:transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%23333' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 9px center/10px;font-size:var(--xs-fs-xs);font-weight:600;color:var(--sc);cursor:pointer}
html body .pe-page .pe-scope select.scope:focus-visible{outline:3px solid var(--xs-focus);outline-offset:-4px}

/* blocks: chips, textarea */
html body .pe-page .pe-block{padding:10px 0;border-top:1px solid var(--xs-line)}
html body .pe-page .pe-h+.pe-block,html body .pe-page summary+.pe-block{border-top:0}
html body .pe-page .pe-bk{display:block;font-size:var(--xs-fs-base);color:var(--xs-ink-2);margin:0 0 8px}
html body .pe-page .pe-block textarea{min-height:84px;margin:0;border:1px solid transparent;background:var(--xs-surface-2);border-radius:var(--xs-r-md);font-size:var(--xs-fs-base);color:var(--xs-ink);padding:10px 12px}
html body .pe-page .pe-block textarea:focus{border-color:var(--xs-focus);background:var(--xs-surface)}
html body .pe-page .chip-options{gap:8px}
html body .pe-page .chip-option::after{content:"";position:absolute;inset:-4px 0}
html body .pe-page .chip-option span{display:flex;align-items:center;min-height:36px;padding:0 13px;border-radius:var(--xs-r-pill);border:1px solid var(--xs-line-strong);background:var(--xs-surface);color:var(--xs-ink-2);font-size:var(--xs-fs-sm)}
html body .pe-page .chip-option input:checked+span{background:var(--xs-el-soft);border-color:var(--xs-el);color:var(--xs-el);font-weight:600}
html body .pe-page .chip-option input:focus-visible+span{outline:3px solid var(--xs-focus);outline-offset:2px}
html body .pe-page .pe-checks{display:flex;flex-wrap:wrap;gap:8px;padding:4px 0 6px}
html body .pe-page .pe-suggest{min-height:var(--xs-tap);font-size:var(--xs-fs-sm);color:var(--xs-primary)}

/* folds */
html body .pe-page details.pe-fold>summary,html body .pe-page details.pe-why>summary{list-style:none;display:flex;align-items:center;gap:6px;min-height:48px;cursor:pointer;font-size:var(--xs-fs-base);color:var(--xs-ink-2)}
html body .pe-page details.pe-fold>summary::-webkit-details-marker,html body .pe-page details.pe-why>summary::-webkit-details-marker{display:none}
html body .pe-page details.pe-fold>summary::after,html body .pe-page details.pe-why>summary::after{content:"";width:7px;height:7px;margin-left:auto;margin-right:4px;border-right:1.5px solid var(--xs-muted);border-bottom:1.5px solid var(--xs-muted);transform:rotate(45deg) translateY(-2px);transition:transform .2s var(--xs-ease);flex:none}
html body .pe-page details[open].pe-fold>summary::after,html body .pe-page details[open].pe-why>summary::after{transform:rotate(-135deg) translate(-2px,0)}
html body .pe-page details.pe-sub,html body .pe-page details.pe-why{border-top:1px solid var(--xs-line);margin:0}
html body .pe-page details.pe-why>summary{font-size:var(--xs-fs-sm);color:var(--xs-muted);min-height:var(--xs-tap)}
html body .pe-page details.pe-why p{font-size:var(--xs-fs-sm);color:var(--xs-muted);line-height:1.6;margin:0 0 8px}
html body .pe-page details.pe-wealth>summary{min-height:52px}
html body .pe-page details.pe-wealth>summary .pe-h{margin:0}
html body .pe-page details.pe-wealth[open]>summary{border-bottom:0}

/* 期待 (inside 想认识 › 筛选条件) */
html body .pe-page .expectations{margin:0 0 8px;padding:0;border:0;background:none}
html body .pe-page .expectations .form-grid{grid-template-columns:1fr;gap:10px}
html body .pe-page .expectations .field label,html body .pe-page .expectations .field-label{font-size:var(--xs-fs-sm);color:var(--xs-ink-2);margin-bottom:6px}
html body .pe-page .expectations .field-row{flex-wrap:wrap}
html body .pe-page .expectations :is(input,select){min-height:var(--xs-tap);font-size:var(--xs-fs-sm);background:var(--xs-surface-2);border-color:transparent;border-radius:var(--xs-r-md)}
html body .pe-page .expectations .field-row input{flex:1 1 90px}
html body .pe-page .expectations .field-row .scope{width:104px;font-size:var(--xs-fs-sm);color:var(--xs-ink-2)}

/* link rows */
html body .pe-page .pe-links .pe-link{display:grid;grid-template-columns:auto 1fr 10px;align-items:center;gap:10px;width:100%;min-height:54px;padding:0;margin:0;border:0;border-top:1px solid var(--xs-line);border-radius:0;background:none;color:var(--xs-ink);font-size:var(--xs-fs-base);text-align:left;text-decoration:none;cursor:pointer}
html body .pe-page .pe-links .pe-link:first-child{border-top:0}
html body .pe-page .pe-links .pe-link small{font-size:var(--xs-fs-sm);color:var(--xs-muted);text-align:right}
html body .pe-page .pe-links .pe-link::after{content:"";width:7px;height:7px;border-right:1.5px solid var(--xs-muted);border-top:1.5px solid var(--xs-muted);transform:rotate(45deg)}
html body .pe-page .pe-links .pe-link[aria-expanded="true"]::after{transform:rotate(135deg)}
html body .pe-layout~#serious-editor:not(.pe-open){display:none}

/* consents */
html body .pe-page .check-line.pe-check{display:flex!important;align-items:flex-start;gap:10px;min-height:var(--xs-tap);margin:0!important;padding:11px 0;border-top:1px solid var(--xs-line);font-size:var(--xs-fs-base)!important;line-height:1.45;color:var(--xs-ink-2)!important;cursor:pointer}
html body .pe-page .pe-h+.check-line.pe-check{border-top:0}
html body .pe-page .check-line.pe-check input{width:20px!important;height:20px;min-height:20px!important;margin:1px 0 0!important;accent-color:var(--xs-primary);flex:none}
html body .pe-page .check-line.pe-check a{color:var(--xs-primary);text-underline-offset:3px;display:inline-block;padding:12px 2px;margin:-12px 0}
html body .pe-page #profile-error:empty{display:none}
html body .pe-page #profile-error{font-size:var(--xs-fs-sm);margin:4px 0 0}

/* sticky save bar */
html body .pe-page .pe-save{position:sticky;bottom:0;z-index:5;display:block;margin:0 -2px;padding:10px 2px calc(10px + env(safe-area-inset-bottom));background:linear-gradient(to top,var(--xs-paper) 75%,rgba(247,244,236,0))}
html body .pe-page .pe-save .primary{display:flex;align-items:center;justify-content:center;width:100%;min-height:52px;font-size:var(--xs-fs-md);font-weight:600;border-radius:var(--xs-r-lg)}
html body .pe-page .pe-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:6px 2px 18px;font-size:var(--xs-fs-sm);color:var(--xs-muted)}
html body .pe-page .pe-foot>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html body .pe-page .pe-contact{font-size:var(--xs-fs-sm);min-height:var(--xs-tap);display:inline-flex;align-items:center;white-space:nowrap;margin:0 0 0 auto}
html body .pe-page .pe-danger{color:var(--xs-danger);font-size:var(--xs-fs-sm);min-height:var(--xs-tap);white-space:nowrap;margin:0}
@media(max-width:640px){
  html body .pe-page{padding:16px 16px 24px}
  html body .pe-page .pe-save{bottom:calc(60px + env(safe-area-inset-bottom));padding-bottom:10px}
  html body .pe-page .page-heading{flex-direction:row}
}

/* publish dialog */
html body #publish-dialog{padding:20px 18px 0}
html body #publish-dialog h2{font:600 var(--xs-fs-xl)/1.3 var(--xs-serif);margin:4px 0 10px;text-wrap:balance}
html body #publish-dialog .ps-preview-note{font-size:var(--xs-fs-sm);color:var(--xs-muted);margin:0 0 8px}
html body #publish-dialog .pe-vis-sum{margin:12px 0 0;border-top:1px solid var(--xs-line)}
html body #publish-dialog .pe-vis-sum>div{display:grid;grid-template-columns:5.5em 1fr;gap:8px;padding:9px 0;border-bottom:1px solid var(--xs-line);font-size:var(--xs-fs-sm);line-height:1.5}
html body #publish-dialog .pe-vis-sum dt{color:var(--xs-muted)}
html body #publish-dialog .pe-vis-sum dd{margin:0;color:var(--xs-ink-2);text-wrap:pretty}
html body #publish-dialog .fine-print{font-size:var(--xs-fs-sm);color:var(--xs-muted);margin:10px 0 0;text-wrap:pretty}
html body #publish-dialog #publish-content label.check-line{display:flex!important;gap:10px;min-height:var(--xs-tap);align-items:center;font-size:var(--xs-fs-sm)!important;color:var(--xs-ink-2)!important;margin:8px 0 0!important}
html body #publish-dialog .actions{position:sticky;bottom:0;display:grid;grid-template-columns:1fr 1.6fr;gap:10px;margin:14px -18px 0;padding:12px 18px calc(14px + env(safe-area-inset-bottom));background:var(--xs-surface);border-top:1px solid var(--xs-line)}
html body #publish-dialog .actions button{min-height:48px;font-size:var(--xs-fs-base);margin:0;width:100%}
html body #publish-dialog .actions .primary{display:flex;align-items:center;justify-content:center;gap:8px}
html body #publish-dialog .pe-vis-sum dd span{white-space:nowrap}
/* chip input covers the whole chip (bigger hit area, nothing hidden under the sticky bar) */
html body .pe-page .chip-option input{inset:-4px 0;width:100%;height:calc(100% + 8px);margin:0;z-index:1;cursor:pointer}
/* keep focused fields clear of the sticky save bar + bottom nav (WCAG 2.4.11) */
html:has(.pe-page){scroll-padding-bottom:100px}
@media(max-width:640px){html:has(.pe-page){scroll-padding-bottom:160px;scroll-padding-top:12px}}

/* review-fix r1: progress hint, private note, inline serious message */
html body .pe-page .pe-progress{margin:0 0 12px;padding:10px 14px;border-radius:var(--xs-r-md);background:var(--xs-primary-soft);color:var(--xs-ink);font-size:var(--xs-fs-sm);line-height:1.6}
html body .pe-page .pe-progress b{font-size:var(--xs-fs-base)}
html body .pe-page .pe-progress.is-done{background:var(--xs-surface-2)}
html body .pe-page .pe-private-note{color:var(--xs-ink-2);font-weight:600}
html body .pe-page details.pe-work>summary .pe-h{margin:0}
html body .pe-page .pe-inline-msg{margin:4px 0 8px;padding:10px 12px;border-radius:var(--xs-r-md);background:#f6ead0;color:var(--xs-ink);font-size:var(--xs-fs-sm);line-height:1.6}
