/* ============================================================
   MY PROFILE EDITOR - /profile.html (profile-editor.js)
   Sits on the staff/gold shell (staff/staff.css). Prefix pe-.
   The sticky preview pane holds a real .pf root, styled by
   profile/profile.css (PROFILES-DESIGN.md section 6).
   ============================================================ */

.pe-page .rk-hero-text { max-width: 980px; }

/* ---- Discord return notice ---- */
.pe-notice { position: relative; margin-top: 1.6rem; padding: 0.9rem 3rem 0.9rem 1.1rem; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,0.03); color: var(--muted); font-size: 0.94rem; }
.pe-notice b { color: var(--text); margin-right: 0.3rem; }
.pe-notice.is-ok { border-color: rgba(95,227,154,0.45); background: rgba(95,227,154,0.07); }
.pe-notice.is-ok b { color: var(--st-ok); }
.pe-notice.is-info { border-color: rgba(116,217,255,0.45); background: rgba(116,217,255,0.07); }
.pe-notice.is-info b { color: var(--st-info); }
.pe-notice.is-bad { border-color: rgba(255,92,72,0.45); background: rgba(255,92,72,0.07); }
.pe-notice.is-bad b { color: #ffb0a6; }
.pe-notice-x { position: absolute; top: 0.4rem; right: 0.5rem; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 1.4rem; cursor: pointer; }
.pe-notice-x:hover { color: var(--text); background: rgba(255,255,255,0.06); }

/* ---- summary card ---- */
.pe-top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) auto; gap: 1.2rem 1.8rem; align-items: center; }
.pe-top-who { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.pe-top-av .st-avatar.is-big { width: 72px; height: 72px; }
.pe-top-text { min-width: 0; }
.pe-top-text h2 { margin: 0 0 0.2rem; font-family: "Cinzel", serif; font-size: 1.4rem; color: var(--text); overflow-wrap: anywhere; }
.pe-top-text p { margin: 0; font-size: 0.88rem; color: var(--muted); overflow-wrap: anywhere; }
.pe-top-text a { color: var(--fx); text-decoration: none; }
.pe-top-text a:hover { text-decoration: underline; }
.pe-hidden-tag { color: var(--st-warn); font-weight: 700; }
.pe-top-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 0.6rem; }
.pe-save { font-size: 0.86rem; color: var(--muted); text-align: right; }
.pe-save::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 0.45rem; border-radius: 50%; background: var(--st-ok); vertical-align: 1px; }
.pe-save[data-state="dirty"]::before, .pe-save[data-state="saving"]::before { background: var(--fx); animation: pe-blink 1s ease-in-out infinite; }
.pe-save[data-state="error"] { color: #ffb0a6; }
.pe-save[data-state="error"]::before { background: var(--st-bad); }
.pe-retry { margin-left: 0.4rem; padding: 0.2rem 0.6rem; min-height: 32px; border-radius: 6px; border: 1px solid rgba(255,92,72,0.5); background: transparent; color: #ffd2cc; font: inherit; font-weight: 700; cursor: pointer; }
@keyframes pe-blink { 50% { opacity: 0.35; } }

.pe-meter-head { display: flex; align-items: baseline; gap: 0.5rem; }
.pe-meter-head b { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 1.5rem; color: var(--fx); }
.pe-meter-head span { font-size: 0.88rem; color: var(--muted); }
.pe-meter-bar { position: relative; height: 8px; margin: 0.4rem 0 0.5rem; border-radius: 99px; background: rgba(255,255,255,0.07); overflow: hidden; }
.pe-meter-bar i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: linear-gradient(90deg, #d9a93a, var(--fx), var(--fx-bright)); box-shadow: 0 0 12px var(--fx-dim); transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.pe-meter-next { margin: 0 0 0.5rem; font-size: 0.9rem; color: var(--text); }
.pe-meter-next a { color: var(--fx); }
.pe-steps { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0; padding: 0; list-style: none; }
.pe-steps a { display: inline-flex; align-items: center; gap: 0.3rem; min-height: 30px; padding: 0.15rem 0.6rem; border-radius: 99px; border: 1px solid var(--line); font-size: 0.8rem; color: var(--muted); text-decoration: none; }
.pe-steps a:hover { border-color: var(--fx-line); color: var(--text); }
.pe-steps .is-done a { color: var(--st-ok); border-color: rgba(95,227,154,0.35); background: rgba(95,227,154,0.06); }
.pe-steps .pf-i { width: 13px; height: 13px; }

/* ---- layout: editor left, sticky preview right ---- */
.pe-layout { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 1.6rem; align-items: start; }
.pe-main { display: grid; gap: 1.2rem; min-width: 0; scroll-margin-top: 110px; }
.pe-preview { position: sticky; top: calc(var(--zl-header-bottom, 69px) + 15px); min-width: 0; } /* 15px under the header's visible bottom (includes.js) */
.pe-preview-toggle { display: none; }

.pe-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.35rem; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,0.025); }
.pe-tabs button { min-height: 44px; padding: 0.45rem 0.95rem; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted); font: inherit; font-size: 0.9rem; font-weight: 700; letter-spacing: 0.02em; cursor: pointer; }
.pe-tabs button:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.pe-tabs button[aria-selected="true"] { color: #14161d; background: var(--fx); border-color: var(--fx); }
.pe-tabs button:focus-visible { outline: 2px solid var(--fx); outline-offset: 2px; }
.pe-panel-plain { display: grid; gap: 1.2rem; }

.pe-sub { margin-top: 1.6rem; padding-top: 1.3rem; border-top: 1px solid var(--line); }
.pe-sub.is-first { margin-top: 0; padding-top: 0; border-top: 0; }
.pe-h3 { display: flex; align-items: baseline; gap: 0.6rem; margin: 0 0 0.6rem; font-family: "Cinzel", serif; font-size: 1.08rem; color: var(--text); }
.pe-help { margin: 0.2rem 0 0.7rem; font-size: 0.86rem; color: var(--muted); }
.pe-help a, .pe-empty a { color: var(--fx); }
.pe-muted { color: var(--muted); }
.pe-inline-count { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.8rem; font-weight: 500; color: var(--muted); letter-spacing: 0; text-transform: none; }
.pe-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.pe-row .st-select { flex: 1 1 200px; width: auto; }
.pe-err { display: block; font-style: normal; font-size: 0.84rem; color: #ffb0a6; }
.pe-err:empty { display: none; }
.st-input[aria-invalid="true"], .st-textarea[aria-invalid="true"] { border-color: rgba(255,92,72,0.6); }
[data-count-for] { font-family: "JetBrains Mono", ui-monospace, monospace; margin-right: 0.5rem; }
[data-count-for].is-near { color: var(--st-warn); }
.pe-bio { min-height: 150px; }
.pe-facts { margin-top: 0.4rem; }

/* ---- country picker ---- */
.pe-country { position: relative; }
.pe-country-btn { display: flex; align-items: center; gap: 0.5rem; width: 100%; text-align: left; cursor: pointer; }
.pe-country-btn::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-3px); }
.pe-country-btn .pe-flag { margin-right: 0.5rem; }
.pe-flag { width: 20px; height: 15px; flex: 0 0 auto; border-radius: 2px; object-fit: cover; box-shadow: 0 0 0 1px rgba(255,255,255,0.15); }
.pe-country-pop { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); padding: 0.5rem; border-radius: 12px; border: 1px solid var(--fx-line); background: #12151d; box-shadow: 0 18px 50px rgba(0,0,0,0.6); }
.pe-country-pop ul { max-height: 280px; overflow-y: auto; margin: 0.5rem 0 0; padding: 0; list-style: none; overscroll-behavior: contain; }
.pe-country-pop button { display: flex; align-items: center; gap: 0.6rem; width: 100%; min-height: 40px; padding: 0.35rem 0.6rem; border: 0; border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: 0.92rem; text-align: left; cursor: pointer; }
.pe-country-pop button:hover, .pe-country-pop button:focus-visible { background: var(--fx-dim); outline: none; }
.pe-country-pop button[aria-selected="true"] { color: var(--fx); font-weight: 700; }
.pe-empty-li { padding: 0.6rem; color: var(--muted); font-size: 0.9rem; }

/* ---- chips (playstyle) ---- */
.pe-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.pe-chip { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 44px; padding: 0.35rem 0.9rem; border-radius: 99px; border: 1px solid var(--line); background: rgba(255,255,255,0.03); color: var(--muted); font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.pe-chip .pf-i, .pe-chip .pe-wi { width: 18px; height: 18px; }
.pe-wi { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pe-chip:hover:not(:disabled) { border-color: var(--fx-line); color: var(--text); }
.pe-chip.is-on { color: #14161d; background: var(--fx); border-color: var(--fx); }
.pe-chip:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---- media (avatar / banner) ---- */
.pe-locked { margin-bottom: 1rem; }
.pe-media { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 1.6rem; }
.pe-media-row { display: flex; gap: 1rem; align-items: flex-start; }
.pe-media-row.is-banner { flex-direction: column; }
.pe-media-cur { position: relative; overflow: hidden; flex: 0 0 auto; background: #0d0f16; border: 1px solid var(--line); }
.pe-media-cur.is-avatar { width: 112px; height: 112px; border-radius: 50%; }
.pe-media-cur.is-banner { width: 100%; aspect-ratio: 16 / 5; border-radius: 12px; }
.pe-media-cur img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pe-media-cur .pf-ribbon { font-family: "JetBrains Mono", ui-monospace, monospace; }
.pe-media-cur.is-avatar .pf-ribbon.is-avatar { left: 0; right: 0; bottom: 12%; }
.pe-media-blank { display: grid; place-items: center; width: 100%; height: 100%; padding: 0.6rem; text-align: center; font-family: "Cinzel", serif; font-size: 2.4rem; color: var(--fx); }
.pe-media-blank.is-banner { font-family: inherit; font-size: 0.86rem; color: var(--muted); }
.pe-media-info { min-width: 0; flex: 1 1 auto; }
.pe-mod { margin: 0 0 0.6rem; font-size: 0.88rem; color: var(--muted); }
.pe-mod:empty { display: none; }
.pe-mod-tag { display: inline-block; margin-right: 0.3rem; padding: 0.1rem 0.5rem; border-radius: 99px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; border: 1px solid; }
.pe-mod-tag.is-pending { color: #ffc85a; border-color: rgba(255,176,32,0.55); background: rgba(255,176,32,0.1); }
.pe-mod-tag.is-rejected { color: #ffb0a6; border-color: rgba(255,92,72,0.5); background: rgba(255,92,72,0.08); }
.pe-mod-tag.is-ok { color: var(--st-ok); border-color: rgba(95,227,154,0.45); background: rgba(95,227,154,0.07); }
.pe-file { position: relative; overflow: hidden; margin: 0; cursor: pointer; }
.pe-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.pe-file.is-disabled { opacity: 0.45; pointer-events: none; }
.pe-file:focus-within { outline: 2px solid var(--fx); outline-offset: 2px; }

.pe-crop { margin-top: 1rem; padding: 1rem; border-radius: 12px; border: 1px solid var(--fx-line); background: rgba(255,217,100,0.04); }
.pe-crop-stage { position: relative; width: 100%; overflow: hidden; border-radius: 10px; background: #07080d; cursor: grab; touch-action: none; user-select: none; }
.pe-crop-stage.is-drag { cursor: grabbing; }
.pe-crop-stage:focus-visible { outline: 2px solid var(--fx); outline-offset: 2px; }
.pe-crop-stage canvas { display: block; }
.pe-crop-stage.is-round { max-width: 360px; margin-inline: auto; }
.pe-crop-stage.is-round::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle closest-side, transparent 98%, rgba(7,8,13,0.62) 100%); box-shadow: inset 0 0 0 2px rgba(255,217,100,0.35); border-radius: 10px; }
.pe-crop-stage:not(.is-round)::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 33%; pointer-events: none; border-right: 1px dashed rgba(255,255,255,0.35); background: rgba(0,0,0,0.12); }
.pe-crop-zoom { display: flex; align-items: center; gap: 0.7rem; margin: 0.8rem 0 0.2rem; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.pe-crop-zoom input { flex: 1; accent-color: var(--fx); min-height: 32px; }
.pe-progress { position: relative; height: 28px; margin: 0.6rem 0; border-radius: 8px; background: rgba(255,255,255,0.06); overflow: hidden; }
.pe-progress i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #d9a93a, var(--fx)); transition: width 0.2s linear; }
.pe-progress.is-working i { background: repeating-linear-gradient(135deg, #d9a93a 0 12px, var(--fx) 12px 24px); background-size: 34px 34px; animation: pe-stripes 0.8s linear infinite; }
.pe-progress span { position: relative; display: block; padding: 0 0.7rem; line-height: 28px; font-size: 0.8rem; font-weight: 700; color: #14161d; mix-blend-mode: normal; text-shadow: 0 0 6px rgba(255,255,255,0.4); }
@keyframes pe-stripes { to { background-position: 34px 0; } }

/* ---- presets, frames, accent ---- */
.pe-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.7rem; }
.pe-preset { position: relative; display: block; padding: 0; overflow: hidden; border-radius: 10px; border: 2px solid transparent; background: #0d0f16; color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.pe-preset img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 5; object-fit: cover; transition: transform 0.3s ease; }
.pe-preset span { position: absolute; left: 0; right: 0; bottom: 0; padding: 0.9rem 0.55rem 0.3rem; font-size: 0.78rem; font-weight: 700; text-transform: capitalize; background: linear-gradient(transparent, rgba(0,0,0,0.8)); }
.pe-preset:hover img { transform: scale(1.04); }
.pe-preset.is-on { border-color: var(--fx); box-shadow: 0 0 0 3px var(--fx-dim), 0 0 18px var(--fx-dim); }
.pe-preset:focus-visible, .pe-frame:focus-visible, .pe-pick:focus-visible, .pe-swatch:focus-visible { outline: 2px solid var(--fx); outline-offset: 2px; }

.pe-frames { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 0.7rem; }
.pe-frame { display: flex; flex-direction: column; align-items: center; gap: 0.45rem; padding: 0.7rem 0.4rem; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,0.025); color: var(--muted); font: inherit; font-size: 0.82rem; font-weight: 700; cursor: pointer; }
.pe-frame:hover { border-color: var(--fx-line); color: var(--text); }
.pe-frame.is-on { border-color: var(--fx); color: var(--fx); background: var(--fx-dim); }
.pe-frame-av.pf-avatar { --av: 64px; --pf-a-ink: var(--fx); --pf-display: "Cinzel", serif; isolation: isolate; }
.pe-frame-av .pf-avatar-letter { font-size: 1.5rem; }

.pe-accent { gap: 0.7rem; }
.pe-accent input[type="color"] { width: 64px; min-height: 44px; }
.pe-swatches { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pe-swatch { width: 36px; height: 36px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.18); background: var(--c); cursor: pointer; box-shadow: 0 0 12px color-mix(in srgb, var(--c) 40%, transparent); }
.pe-swatch.is-on { border-color: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 45%, transparent); }

/* ---- links ---- */
.pe-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem 1.4rem; }
.pe-link { --net: var(--fx); display: grid; gap: 0.35rem; min-width: 0; }
.pe-link[data-net="twitch"] { --net: #a970ff; } .pe-link[data-net="youtube"] { --net: #ff4e45; } .pe-link[data-net="kick"] { --net: #53fc18; }
.pe-link[data-net="tiktok"] { --net: #25f4ee; } .pe-link[data-net="x"] { --net: #e7e9ea; } .pe-link[data-net="instagram"] { --net: #ff5ca8; }
.pe-link[data-net="discordServer"] { --net: #7289ff; } .pe-link[data-net="steamGroup"] { --net: #66c0f4; } .pe-link[data-net="website"] { --net: var(--fx); }
.pe-link-label { display: flex; align-items: center; gap: 0.45rem; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.pe-link-label .pf-i { width: 18px; height: 18px; color: var(--net); }
.pe-link.is-ok .st-input { border-color: color-mix(in srgb, var(--net) 45%, transparent); }
.pe-link-out { display: flex; align-items: center; gap: 0.35rem; min-height: 1.3em; margin: 0; font-size: 0.84rem; overflow-wrap: anywhere; }
.pe-link-out .pf-i { width: 14px; height: 14px; flex: 0 0 auto; color: var(--net); }
.pe-link-out a { color: var(--text); text-decoration: none; border-bottom: 1px dotted var(--net); }
.pe-link-out a:hover { color: var(--net); }

/* ---- showcase picks ---- */
.pe-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.6rem; }
.pe-picks.is-art { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.pe-pick { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; min-height: 64px; padding: 0.7rem 0.75rem; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,0.025); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.pe-pick:hover:not(:disabled) { border-color: var(--fx-line); }
.pe-pick.is-on { border-color: var(--fx); background: var(--fx-dim); box-shadow: 0 0 16px var(--fx-dim); }
.pe-pick:disabled { opacity: 0.4; cursor: not-allowed; }
.pe-pick b { font-size: 0.9rem; line-height: 1.2; overflow-wrap: anywhere; }
.pe-pick small { font-size: 0.78rem; color: var(--muted); }
.pe-pick small.is-wanted { color: #ff7a8a; }
.pe-pick small.is-owned { color: var(--st-ok); }
.pe-pick-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: rgba(255,255,255,0.05); color: var(--fx); }
.pe-pick-ico svg { width: 22px; height: 22px; }
.pe-pick-ico .wi { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pe-pick-art { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: #0d0f16; }
.pe-pick-no { position: absolute; top: -8px; right: -8px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--fx); color: #14161d; font-style: normal; font-weight: 800; font-size: 0.8rem; box-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.pe-empty { margin: 0; padding: 1rem; border-radius: 10px; border: 1px dashed var(--line); color: var(--muted); font-size: 0.9rem; }

.pe-best { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.6rem; }
.pe-best .st-select { grid-column: 1 / -1; }
.pe-radio { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.75rem 0.9rem; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,0.025); cursor: pointer; }
.pe-radio input { margin-top: 0.25rem; accent-color: var(--fx); }
.pe-radio b { display: block; color: var(--text); font-size: 0.94rem; }
.pe-radio small { display: block; color: var(--muted); font-size: 0.82rem; }
.pe-radio:has(input:checked) { border-color: var(--fx-line); background: var(--fx-dim); }
.pe-radio:has(input:disabled) { opacity: 0.5; cursor: not-allowed; }

.pe-clip-prev:empty { display: none; }
.pe-clip-card { display: inline-grid; gap: 0.4rem; max-width: 320px; margin-top: 0.7rem; padding: 0.5rem; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,0.03); color: var(--muted); font-size: 0.82rem; text-decoration: none; overflow-wrap: anywhere; }
.pe-clip-card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; }
.pe-clip-ph { display: grid; place-items: center; gap: 0.3rem; aspect-ratio: 16 / 9; border-radius: 8px; background: rgba(169,112,255,0.12); color: #c9a8ff; font-weight: 700; }
.pe-clip-ph .pf-i { width: 32px; height: 32px; }

/* ---- privacy ---- */
.pe-privacy { display: grid; gap: 0.6rem; }
.pe-priv.is-warn:has(input:checked) { border-color: rgba(255,179,71,0.55); background: rgba(255,179,71,0.07); }
.pe-priv.is-warn:has(input:checked) strong { color: var(--st-warn); }

/* ---- Discord ---- */
.pe-dc { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem 1rem; padding: 1rem 1.1rem; border-radius: 14px; border: 1px solid rgba(114,137,255,0.35); background: linear-gradient(120deg, rgba(88,101,242,0.14), rgba(88,101,242,0.03)); }
.pe-dc.is-off { border-color: var(--line); background: rgba(255,255,255,0.025); }
.pe-dc-av { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.pe-dc-av.is-blank { display: grid; place-items: center; background: #5865f2; color: #fff; }
.pe-dc.is-off .pe-dc-av.is-blank { background: #2b2f3d; color: #8f9bb5; }
.pe-dc-av .pf-i { width: 28px; height: 28px; }
.pe-dc-text { flex: 1 1 200px; min-width: 0; }
.pe-dc-text b { display: block; color: var(--text); font-size: 1.02rem; overflow-wrap: anywhere; }
.pe-dc-text small { display: block; color: var(--muted); font-size: 0.84rem; }
.pe-dc-btn { gap: 0.45rem; background: #5865f2; border-color: #5865f2; color: #fff; }
.pe-dc-btn:hover { background: #6d78ff; border-color: #6d78ff; color: #fff; }
.pe-dc-btn .pf-i { width: 18px; height: 18px; }
.pe-discord + .pe-sub { margin-top: 1.3rem; }

/* ---- preview pane ---- */
.pe-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 0.6rem; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
.pe-preview-head a { color: var(--fx); letter-spacing: 0.06em; text-transform: none; font-size: 0.86rem; }
.pe-preview .pf-preview-frame { max-height: calc(100vh - 160px); overflow-y: auto; scrollbar-width: thin; }
.pe-preview .pf { min-height: 0; }
.pe-preview .pf-actions { pointer-events: none; }
.pe-preview-foot { margin-top: 0.7rem; font-size: 0.82rem; }

/* the preview pane is small: stat strip stays two columns inside it */
.pe-preview .pf-name { margin: 0; }

/* ---- responsive ---- */
@media (max-width: 1180px) {
  .pe-layout { grid-template-columns: minmax(0, 1fr) 360px; }
}
@media (max-width: 1020px) {
  .pe-top { grid-template-columns: minmax(0, 1fr); }
  .pe-top-actions { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
  .pe-layout { grid-template-columns: minmax(0, 1fr); }
  .pe-preview { position: static; order: -1; display: none; }
  .pe-preview.is-open { display: block; }
  .pe-preview .pf-preview-frame { max-height: none; max-width: 460px; margin-inline: auto; }
  .pe-preview-toggle { display: inline-flex; justify-self: start; }
  .pe-media { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .pe-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pe-tabs button { padding-inline: 0.5rem; }
  .pe-media-row { flex-direction: column; }
  .pe-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pe-frames { grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); }
  .pe-picks, .pe-picks.is-art { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pe-save { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .pe-meter-bar i, .pe-preset img, .pe-progress i { transition: none; }
  .pe-save::before, .pe-progress.is-working i { animation: none; }
}

/* completeness step landing: brief highlight on the field it jumps to */
.pe-flash { animation: pe-flash 1.6s ease-out; }
@keyframes pe-flash { 0%, 40% { box-shadow: 0 0 0 3px var(--fx), 0 0 22px var(--fx-dim); } 100% { box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .pe-flash { animation: none; outline: 2px solid var(--fx); } }

/* ---- round 2: vanity URL ---- */
.pe-vanity-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.pe-vanity-row .st-input { flex: 1 1 180px; min-width: 0; font-family: "JetBrains Mono", ui-monospace, monospace; }
.pe-vanity-pre { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.9rem; color: var(--muted); }
.pe-slug-state { margin: 0.1rem 0 0; min-height: 1.3em; font-size: 0.88rem; color: var(--muted); overflow-wrap: anywhere; }
.pe-slug-state code { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 0.84rem; color: var(--text); }
.pe-slug-state.is-ok { color: var(--st-ok); }
.pe-slug-state.is-bad { color: #ffb0a6; }
.pe-slug-state.is-lock { color: var(--st-warn); }

/* ---- round 2: followers / following ---- */
.pe-follow-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.4rem; }
.pe-follows { display: grid; gap: 0.45rem; margin: 0; padding: 0; list-style: none; }
.pe-follow { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.7rem; min-height: 52px; padding: 0.45rem 0.7rem; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,0.025); }
.pe-follow .st-btn { margin-left: auto; }
.pe-follow-who { display: inline-flex; align-items: center; gap: 0.55rem; min-width: 0; color: var(--text); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.pe-follow-who:hover { color: var(--fx-bright); }
.pe-follow-who .zl-user-av { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: #0d0f16; }
.pe-follow-who .zl-user-av-none { display: inline-grid; place-items: center; font-family: "Cinzel", serif; color: var(--fx); }

/* ---- staff mode (?as=) ---- */
.pe-staffbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.2rem; padding: 0.9rem 1.1rem; border-radius: 12px; border: 2px solid var(--fx); background: linear-gradient(90deg, rgba(255,217,100,0.16), rgba(255,217,100,0.05)); color: var(--text); box-shadow: 0 0 24px var(--fx-dim); }
.pe-staffbar b { color: var(--fx-bright); }
.pe-staffbar-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; font-size: 0.9rem; }
.pe-staffbar-links a { color: var(--fx); }
.pe-staff-mode .pe-top { border-color: var(--fx-line); }
.pe-staff-mode .rk-tagline .st-role-pill { vertical-align: 2px; margin-right: 0.3rem; }
.pe-denied { margin-top: 2rem; }

/* ---- Account panel: Survivor since row (click-to-edit for staff) ---- */
.pe-fact-note { display: block; margin-top: 0.15rem; font-size: 0.78rem; color: var(--muted); }
.pe-fact-edit { display: inline-flex; align-items: center; gap: 0.4rem; min-height: 32px; margin: 0; padding: 0.1rem 0.35rem 0.1rem 0; border: 0; border-bottom: 1px dashed var(--fx-line); border-radius: 0; background: transparent; color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.pe-fact-edit strong { margin: 0; }
.pe-fact-edit .pf-i { width: 15px; height: 15px; color: var(--fx); opacity: 0.8; }
.pe-fact-edit:hover strong, .pe-fact-edit:focus-visible strong { color: var(--fx-bright); }
.pe-fact-edit:focus-visible { outline: 2px solid var(--fx); outline-offset: 2px; }
.pe-fact-form { display: grid; gap: 0.4rem; margin-top: 0.3rem; }
.pe-fact-form input[type="date"] { color-scheme: dark; }
.pe-fact-form .st-input { min-height: 36px; padding: 0.3rem 0.55rem; font-size: 0.88rem; }

/* completeness at 100%: the meter is hidden and the top card becomes one compact row */
.pe-top.is-complete { grid-template-columns: minmax(0, 1fr) auto; padding-top: 1rem; padding-bottom: 1rem; }
.pe-top.is-complete .pe-top-actions { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.5rem 1rem; }
@media (max-width: 640px) { .pe-top.is-complete { grid-template-columns: minmax(0, 1fr); } .pe-top.is-complete .pe-top-actions { justify-content: flex-start; } }

/* ---------- Link section (owner 2026-10-09): Steam and Discord emblems joined by a beam when linked, dormant when not ---------- */
.pe-link-art { max-width: 420px; margin: 0.4rem auto 1rem; }
.pe-link-art svg { display: block; width: 100%; height: auto; overflow: visible; }
.pe-la-em, .pe-la-node, .pe-la-glow, .pe-la-burst circle { transform-box: fill-box; transform-origin: center; }
.pe-la-disc { fill: #1b1e2a; stroke: rgba(255, 255, 255, 0.14); stroke-width: 2; transition: fill 0.5s ease, stroke 0.5s ease; }
.pe-la-em { color: #7d879d; transition: transform 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2), color 0.5s ease; }
.pe-la-em.is-steam { transform: translateX(-10px); }
.pe-la-em.is-discord { transform: translateX(10px); }
.pe-la-glow { opacity: 0; transition: opacity 0.6s ease; }
.pe-la-gap { fill: none; stroke: #3a4054; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 3 7; animation: pe-la-drift 3s linear infinite; transition: stroke 0.3s ease; }
.pe-la-beam { opacity: 0; transition: opacity 0.4s ease; }
.pe-la-core { fill: none; stroke: url(#peLinkBeam); stroke-width: 4; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.45)); }
.pe-la-flow { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 2 16; opacity: 0.85; animation: pe-la-flow 1.4s linear infinite; }
.pe-la-node-ring { fill: #1b1e2a; stroke: #3a4054; stroke-width: 2.5; transition: stroke 0.4s ease; }
.pe-la-node-tick { fill: none; stroke: #7dffb0; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity 0.4s ease; }
.pe-la-burst circle { opacity: 0; fill: #ffe08a; }
.pe-la-burst circle:nth-child(3n + 2) { fill: #8b95ff; }
.pe-la-burst circle:nth-child(3n) { fill: #fff; }

/* hovering or focusing the Link button pulls the two emblems toward each other */
.pe-link.is-hint:not(.is-linked) .pe-la-em.is-steam { transform: translateX(-3px); }
.pe-link.is-hint:not(.is-linked) .pe-la-em.is-discord { transform: translateX(3px); }
.pe-link.is-hint:not(.is-linked) .pe-la-gap { stroke: #8b95ff; animation-duration: 0.9s; }
.pe-link.is-hint:not(.is-linked) .pe-la-em { color: #c9cfdc; }

/* linked: emblems lit and touching the beam, the beam flows, the middle node shows the tick */
.pe-link.is-linked .pe-la-em { transform: none; }
.pe-link.is-linked .pe-la-em.is-steam { color: #ffe08a; }
.pe-link.is-linked .pe-la-em.is-steam .pe-la-disc { stroke: rgba(230, 200, 74, 0.7); }
.pe-link.is-linked .pe-la-em.is-discord { color: #fff; }
.pe-link.is-linked .pe-la-em.is-discord .pe-la-disc { fill: #5865f2; stroke: rgba(139, 149, 255, 0.8); }
.pe-link.is-linked .pe-la-glow { opacity: 1; animation: pe-la-breathe 3.2s ease-in-out infinite; }
.pe-link.is-linked .pe-la-gap { opacity: 0; animation: none; }
.pe-link.is-linked .pe-la-beam { opacity: 1; }
.pe-link.is-linked .pe-la-node-ring { stroke: #7dffb0; }
.pe-link.is-linked .pe-la-node-tick { opacity: 1; }

/* the link-up, played once after Discord sends you back linked */
.pe-link.is-celebrate .pe-la-core { stroke-dasharray: 168; animation: pe-la-draw 0.9s cubic-bezier(0.6, 0, 0.2, 1) both; }
.pe-link.is-celebrate .pe-la-flow { animation-delay: 0.9s; }
.pe-link.is-celebrate .pe-la-node { animation: pe-la-pop 0.6s 0.8s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
.pe-link.is-celebrate .pe-la-glow { animation: pe-la-flash 1.2s 0.85s ease-out both; }
.pe-link.is-celebrate .pe-la-burst circle { animation: pe-la-burst 1.1s 0.9s ease-out both; }
.pe-la-burst circle:nth-child(1) { --dx: 46px; --dy: 0px; }
.pe-la-burst circle:nth-child(2) { --dx: 37px; --dy: 27px; }
.pe-la-burst circle:nth-child(3) { --dx: 14px; --dy: 44px; }
.pe-la-burst circle:nth-child(4) { --dx: -14px; --dy: 44px; }
.pe-la-burst circle:nth-child(5) { --dx: -37px; --dy: 27px; }
.pe-la-burst circle:nth-child(6) { --dx: -46px; --dy: 0px; }
.pe-la-burst circle:nth-child(7) { --dx: -37px; --dy: -27px; }
.pe-la-burst circle:nth-child(8) { --dx: -14px; --dy: -44px; }
.pe-la-burst circle:nth-child(9) { --dx: 14px; --dy: -44px; }
.pe-la-burst circle:nth-child(10) { --dx: 37px; --dy: -27px; }

/* the Link button: a light sweep on hover */
.pe-link .pe-dc-btn { position: relative; overflow: hidden; transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease; }
.pe-link .pe-dc-btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%); transform: translateX(-120%); transition: transform 0.6s ease; pointer-events: none; }
.pe-link .pe-dc-btn:hover, .pe-link .pe-dc-btn:focus-visible { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(88, 101, 242, 0.45); }
.pe-link .pe-dc-btn:hover::after, .pe-link .pe-dc-btn:focus-visible::after { transform: translateX(120%); }
.pe-link .pe-notice { margin: 0 0 0.9rem; }

@keyframes pe-la-drift { to { stroke-dashoffset: -20; } }
@keyframes pe-la-flow { to { stroke-dashoffset: -36; } }
@keyframes pe-la-breathe { 50% { opacity: 0.55; } }
@keyframes pe-la-draw { from { stroke-dashoffset: 168; } to { stroke-dashoffset: 0; } }
@keyframes pe-la-pop { 0% { transform: scale(0); } 70% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes pe-la-flash { 0% { opacity: 0.4; transform: scale(0.9); } 30% { opacity: 1; transform: scale(1.35); } 100% { opacity: 1; transform: scale(1); } }
@keyframes pe-la-burst { 0% { opacity: 1; transform: translate(0, 0) scale(1); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.4); } }

@media (prefers-reduced-motion: reduce) {
  .pe-la-gap, .pe-la-flow, .pe-link.is-linked .pe-la-glow { animation: none; }
  .pe-link.is-celebrate .pe-la-core, .pe-link.is-celebrate .pe-la-node, .pe-link.is-celebrate .pe-la-glow, .pe-link.is-celebrate .pe-la-burst circle { animation: none; }
  .pe-la-em, .pe-la-glow, .pe-la-beam, .pe-la-disc, .pe-la-gap, .pe-la-node-ring, .pe-la-node-tick, .pe-link .pe-dc-btn, .pe-link .pe-dc-btn::after { transition: none; }
}
