/* GameBuddy prototype - PROFILE module (docs/PROFILES.md): the public page (prefix pf-) and its editor (prefix pfe-).
   The page is part of the app: it uses the tokens of tokens.css and no colors of its own. What brings color are the covers of the games, the owner's pictures, and one quiet
   color the owner may pick (App.profile.ACCENTS, set by the screen as --pf-pick and the two text shades of it). It draws links, stars, the label of the top game and the line
   under the open tab. Nothing else takes it. Layout follows the width of the page itself (container queries), so the narrow live preview of the editor looks like a phone.
   Sections: the color | page | top game | head | numbers and tabs | sections | games | reviews | links | narrow | states | report | editor | pickers | blocks and favorites | preview and save bar */

/* ---------- the one color ---------- */
.pf { --pf-accent: var(--pf-pick, var(--text)); --pf-link: var(--pf-pick-dark, var(--text-2)); }
:root[data-theme="light"] .pf { --pf-link: var(--pf-pick-light, var(--text-2)); }

/* ---------- page ---------- */
.pf-screen { max-width: 1080px; }
.pf-host { min-width: 0; }
.pf-wrap { container: pfw / inline-size; width: 100%; min-width: 0; }
.pf { min-width: 0; color: var(--text); text-align: left; }
.pf-pic { position: relative; width: 100%; height: 100%; overflow: hidden; background: var(--bg-raised); }
.pf-pic > svg { display: block; width: 100%; height: 100%; }
.pf-pic > img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; opacity: 1; transition: opacity var(--dur-3); }
.pf-pic.is-loading > img { opacity: 0; }

/* ---------- the game at the top ---------- */
.pf-hero { position: relative; height: 260px; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-raised); }
.pf-hero__art { position: absolute; inset: 0; }
.pf-hero__art > * { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0; }
.pf-hero__shade { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(0deg, var(--bg-canvas) 0%, color-mix(in srgb, var(--bg-canvas) 0%, transparent) 55%); }
.pf-hero[data-hero="game"] .pf-hero__shade, .pf-hero:has(.pf-feat) .pf-hero__shade {
  background: linear-gradient(90deg, color-mix(in srgb, var(--bg-canvas) 94%, transparent) 0%, color-mix(in srgb, var(--bg-canvas) 58%, transparent) 40%, color-mix(in srgb, var(--bg-canvas) 0%, transparent) 68%),
    linear-gradient(0deg, var(--bg-canvas) 0%, color-mix(in srgb, var(--bg-canvas) 0%, transparent) 55%); }
.pf-feat { position: absolute; left: 28px; right: 28px; top: 34px; display: flex; flex-direction: column; align-items: flex-start; max-width: 520px; }
.pf-feat__label { font-size: var(--fs-sm); font-weight: 600; color: var(--pf-link); }
.pf-feat__title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin: 4px 0 14px; font-size: 30px; font-weight: 700; letter-spacing: -.015em; line-height: 1.18; overflow-wrap: anywhere; }
.pf-play { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 18px; border-radius: 8px; background: var(--text); color: var(--bg-canvas); font-size: var(--fs-md); font-weight: 600; }
a.pf-play:hover { background: var(--text-2); color: var(--bg-canvas); text-decoration: none; }

/* ---------- head ---------- */
.pf-head { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; column-gap: 20px; row-gap: 12px; padding: 0 2px; }
.pf-avatar { width: 112px; height: 112px; overflow: hidden; border: 3px solid var(--bg-canvas); border-radius: 12px; background: var(--bg-canvas); box-shadow: 0 0 0 1px var(--border-strong); }
.pf--hero .pf-avatar { margin-top: -46px; }
.pf-id { min-width: 0; }
.pf-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin: 0; padding: 1px 0; font-size: 28px; font-weight: 700; letter-spacing: -.012em; line-height: 1.18; color: var(--text); overflow-wrap: anywhere; }
.pf-meta { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; row-gap: 2px; margin: 4px 0 0; min-width: 0; font-size: var(--fs-md); color: var(--text-4); }
.pf-handle { min-width: 0; overflow-wrap: anywhere; }
.pf-since { position: relative; padding-left: 12px; }
.pf-since::before { content: ''; position: absolute; left: 0; top: .62em; width: 3px; height: 3px; border-radius: 50%; background: var(--text-4); opacity: .6; }
.pf-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.pf-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-raised); font-size: var(--fs-sm); color: var(--text-2); white-space: nowrap; }
.pf-badge__icon { display: grid; place-items: center; color: var(--text-4); }
/* the creator's badge keeps one quiet gold whatever color the owner picked for the page */
.pf-badge[data-badge="founder"] { border-color: #c4915a; color: #d6ab7a; }
.pf-badge[data-badge="founder"] .pf-badge__icon { color: inherit; }
:root[data-theme="light"] .pf-badge[data-badge="founder"] { border-color: #845721; color: #845721; }
.pf-badge[data-badge="beta"] { border-color: #7f9cb8; color: #a3bdd6; }
.pf-badge[data-badge="beta"] .pf-badge__icon { color: inherit; }
:root[data-theme="light"] .pf-badge[data-badge="beta"] { border-color: #3f5f7d; color: #3f5f7d; }
.pf-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

/* ---------- numbers and tabs ---------- */
.pf-stats { display: flex; margin: 22px 0 0; padding: 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); list-style: none; }
.pf-stat { flex: 1; min-width: 0; padding: 12px 0 12px 20px; border-left: 1px solid var(--border); }
.pf-stat:first-child { padding-left: 2px; border-left: 0; }
.pf-stat__n { display: block; font-size: 21px; font-weight: 700; line-height: 1.25; }
.pf-stat__label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); color: var(--text-4); }
.pf-tabs { display: flex; gap: 24px; margin-top: 18px; border-bottom: 1px solid var(--border); }
.pf-tab { display: inline-flex; align-items: baseline; gap: 6px; margin-bottom: -1px; padding: 0 0 10px; border: 0; border-bottom: 2px solid transparent; background: none; font-size: var(--fs-base); font-weight: 600; color: var(--text-4); }
button.pf-tab { cursor: pointer; }
button.pf-tab:hover { color: var(--text-2); }
.pf-tab[aria-pressed="true"] { border-bottom-color: var(--pf-accent); color: var(--text); }
.pf-tab__n { font-weight: 500; color: var(--text-4); opacity: .75; }
.pf[data-tab="overview"] .pf-extra { display: none; }
.pf:not([data-tab="overview"]) .pf-all { display: none; }
.pf[data-tab="games"] .pf-main > .pf-card:not([data-part="games"]):not([data-part="favorites"]) { display: none; }
.pf[data-tab="reviews"] .pf-main > .pf-card:not([data-part="reviews"]) { display: none; }

/* ---------- sections ---------- */
.pf-body { display: grid; grid-template-columns: minmax(0, 1fr) 260px; grid-template-areas: 'main side'; align-items: start; column-gap: 36px; }
.pf-side { grid-area: side; min-width: 0; padding-left: 24px; border-left: 1px solid var(--border-subtle); margin-top: 24px; }
.pf-main { grid-area: main; min-width: 0; }
.pf--noside .pf-body { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'main'; }
.pf--noblocks .pf-body { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'side'; }
.pf--noblocks .pf-side { padding-left: 0; border-left: 0; }
.pf-card { min-width: 0; padding-top: 24px; }
.pf-side .pf-card:first-child { padding-top: 0; }
.pf-card--quiet { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 18px; text-align: center; }
.pf-quiet__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--bg-raised); color: var(--text-3); }
.pf-hrow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.pf-h { min-width: 0; margin: 0; font-size: var(--fs-nav); font-weight: 600; letter-spacing: -.005em; line-height: 1.35; color: var(--text); }
.pf-h__text { overflow-wrap: anywhere; }
.pf-all { flex: none; padding: 2px 0; border: 0; background: none; font-size: var(--fs-md); color: var(--text-4); cursor: pointer; }
.pf-all:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.pf-empty { margin: 0; font-size: var(--fs-md); line-height: 1.55; color: var(--text-4); overflow-wrap: anywhere; }
.pf-clamp { min-width: 0; }
.pf-bio { margin: 0; font-size: var(--fs-md); line-height: 1.62; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.pf-bio.is-clamped { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 16; overflow: hidden; }
.pf-more { margin-top: 6px; padding: 2px 0; border: 0; background: none; font-size: var(--fs-md); font-weight: 600; color: var(--pf-link); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- games ---------- */
.pf-games { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.pf-games__item { min-width: 0; }
.pf-game { display: block; color: var(--text); }
a.pf-game:hover { text-decoration: none; }
.pf-game__cover { border: 1px solid var(--border); border-radius: 8px; transition: border-color var(--dur-2); }
a.pf-game:hover .pf-game__cover { border-color: var(--border-strong); }
.pf-game__text { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding-top: 8px; }
.pf-game__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-md); font-weight: 600; color: var(--text); }
.pf-game__genres { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); color: var(--text-4); }

/* ---------- reviews ---------- */
.pf-reviews { margin: 0; padding: 0; list-style: none; }
.pf-review { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 14px 0; border-top: 1px solid var(--border-subtle); }
.pf-review:first-child { padding-top: 0; border-top: 0; }
.pf-review__cover { display: block; align-self: start; overflow: hidden; border-radius: 6px; }
.pf-review__img { border-radius: 6px; }
.pf-review__body { min-width: 0; }
.pf-review__title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: var(--fs-base); font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
a.pf-review__title:hover { text-decoration: underline; text-underline-offset: 3px; }
.pf-review__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 2px 0 5px; font-size: var(--fs-sm); color: var(--text-4); }
.pf-review__meta .pd-rating { --amber-solid: var(--pf-accent); --amber-text: var(--pf-accent); color: var(--pf-accent); }
.pf-review__text { margin: 0; font-size: var(--fs-md); line-height: 1.55; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.pf-review__text.is-clamped { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }

/* ---------- links ---------- */
.pf-links { margin: 0; padding: 0; list-style: none; }
.pf-link { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 9px 0; border-bottom: 1px solid var(--border-subtle); color: var(--pf-link); }
a.pf-link:hover { text-decoration: none; }
a.pf-link:hover .pf-link__host { text-decoration: underline; text-underline-offset: 3px; }
.pf-link__icon { flex: none; display: grid; place-items: center; width: 18px; height: 18px; color: var(--text-4); }
.pf-link__text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.pf-link__host, .pf-link__rest { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-link__host { font-size: var(--fs-md); font-weight: 500; }
.pf-link__rest { font-size: var(--fs-sm); color: var(--text-4); }
.pf-link__out { flex: none; color: var(--text-4); }

/* ---------- narrower pages ---------- */
@container pfw (max-width: 779px) {
  .pf-body { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'side' 'main'; }
  .pf--noside .pf-body { grid-template-areas: 'main'; }
  .pf--noblocks .pf-body { grid-template-areas: 'side'; }
  .pf-side { padding-left: 0; border-left: 0; }
}
@container pfw (max-width: 619px) {
  .pf-hero { height: 190px; }
  .pf-feat { left: 16px; right: 16px; top: 18px; }
  .pf-feat__title { margin-bottom: 10px; font-size: 21px; }
  .pf-head { grid-template-columns: minmax(0, 1fr); row-gap: 10px; }
  .pf-avatar { width: 88px; height: 88px; }
  .pf--hero .pf-avatar { margin-top: -38px; margin-left: 8px; }
  .pf-name { font-size: 23px; }
  .pf-since { padding-left: 0; }                                            /* it often takes a line of its own here: no separator dot then */
  .pf-since::before { display: none; }
  .pf-actions { justify-content: flex-start; }
  .pf-stat { padding-left: 12px; }
  .pf-stat__n { font-size: 18px; }
  .pf-tabs { gap: 18px; overflow-x: auto; scrollbar-width: none; }
  .pf-games { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pf-review { grid-template-columns: 72px minmax(0, 1fr); gap: 10px; }
}
/* ---------- notes, loading, gates ---------- */
.pf-note { margin-bottom: 14px; }
.pf-note__text { margin: 0; }
.pf-note__reason { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.pf-skel { display: flex; flex-direction: column; gap: 16px; }
.pf-skel__row { display: flex; gap: 16px; }
.pf-skel__lines { display: flex; flex: 1; flex-direction: column; gap: 10px; padding-top: 22px; }
.pf-gate { max-width: 640px; margin: 24px auto 0; }

/* ---------- the report dialog ---------- */
.pf-report { display: flex; flex-direction: column; gap: 16px; }
.pf-report__fine { margin: 0; font-size: var(--fs-sm); color: var(--text-3); }

/* =====================================================================
   the editor
   ===================================================================== */
.pfe-host { min-width: 0; }
.pfe-skel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.pfe { container: pfe / inline-size; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pfe > div:empty { display: none; }
.pfe-tabs { display: none; align-self: flex-start; }
.pfe-grid { display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 12fr); align-items: start; gap: 20px; }
.pfe-form { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pfe-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 16px 18px 18px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg-surface); }
.pfe-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pfe-card__title { margin: 0; font-size: var(--fs-nav); font-weight: 600; letter-spacing: -.01em; }
.pfe-card__desc { margin: 3px 0 0; font-size: var(--fs-md); line-height: 1.5; color: var(--text-3); }
.pfe-label { font-size: var(--fs-md); font-weight: 500; color: var(--text-2); }
.pfe-hint { margin: 0; font-size: var(--fs-sm); line-height: 1.5; color: var(--text-3); }
.pfe-hint:empty { display: none; }
.pfe-hint--lock { display: flex; align-items: flex-start; gap: 7px; }
.pfe-hint--lock svg, .pfe-warn svg { flex: none; margin-top: 2px; }
.pfe-warn { display: flex; align-items: flex-start; gap: 7px; margin: 0; font-size: var(--fs-sm); line-height: 1.5; color: var(--amber-text); }
.pfe-warn[hidden] { display: none; }
.pfe-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pfe-public { display: flex; flex-direction: column; gap: 6px; }
.pfe-public__text { margin: 0; font-size: var(--fs-md); line-height: 1.55; color: var(--text-3); overflow-wrap: anywhere; }
.pfe-addr { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding-top: 12px; border-top: 1px solid var(--border-subtle); }
.pfe-address { min-width: 0; }
.pfe-state { display: flex; align-items: baseline; gap: 8px; margin: 0; font-size: var(--fs-sm); line-height: 1.5; color: var(--text-3); }
.pfe-state::before { content: ''; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--gray-solid); transform: translateY(-1px); }
.pfe-state--green::before { background: var(--green-solid); }
.pfe-state--amber::before { background: var(--amber-solid); }
.pfe-state--red::before { background: var(--red-solid); }

/* ---------- pickers ---------- */
.pfe-tick { position: absolute; top: 4px; right: 4px; z-index: 1; display: none; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: var(--accent-fg); box-shadow: 0 0 0 2px var(--bg-surface); }
[aria-checked="true"] > .pfe-tick { display: grid; }
.pfe-accentrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pfe-accents { display: flex; flex-wrap: wrap; gap: 6px; }
.pfe-accent { position: relative; width: 36px; height: 36px; padding: 3px; border: 2px solid transparent; border-radius: 50%; background: none; cursor: pointer; }
.pfe-accent:hover { border-color: var(--border-strong); }
.pfe-accent[aria-checked="true"] { border-color: var(--text); }
.pfe-accent > .pfe-tick { display: none; }
.pfe-accent__dot { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--border-strong); }
.pfe-ownbanner { display: block; overflow: hidden; aspect-ratio: 3 / 1; border: 1px solid var(--border); border-radius: 8px; }
.pfe-pictures { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pfe-grid-avatar { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 6px; }
.pfe-pick { position: relative; display: block; min-width: 0; padding: 2px; border: 2px solid transparent; background: none; cursor: pointer; }
.pfe-pick:hover { border-color: var(--border-strong); }
.pfe-pick[aria-checked="true"] { border-color: var(--accent); }
.pfe-pick--avatar { border-radius: 17px; }
.pfe-preset { display: block; overflow: hidden; background: var(--bg-active); }
.pfe-preset > svg { display: block; width: 100%; height: 100%; }
.pfe-pick--avatar .pfe-preset, .pfe-pick--avatar .pf-pic { display: block; aspect-ratio: 1; height: auto; border-radius: 13px; box-shadow: inset 0 0 0 1px var(--border); }
.pfe-upload { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pfe-links { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-width: 0; }
.pfe-links > .pd-field__error { margin: -3px 0 0 42px; }
.pfe-links > .pd-field__error[hidden] { display: none; }
.pfe-links > button { align-self: flex-start; }
.pfe-linkrow { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pfe-linkrow > :nth-child(2) { flex: 1; min-width: 0; }
.pfe-linkrow > .pf-link__icon { border: 1px solid var(--border); background: var(--bg-raised); color: var(--text-3); width: 34px; height: 34px; }
.pfe-linkrow__pad { flex: none; width: 28px; }

/* ---------- blocks and favorite games ---------- */
.pfe-blocks, .pfe-favs, .pfe-results { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; min-width: 0; }
.pfe-favs:empty, .pfe-results:empty { display: none; }
.pfe-block { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 8px 10px 12px; border: 1px solid var(--border); border-radius: var(--r-inner); background: var(--bg-raised); }
.pfe-block__text { display: flex; flex: 1; flex-direction: column; gap: 1px; min-width: 0; }
.pfe-block__name { font-size: var(--fs-base); font-weight: 600; }
.pfe-block__desc { font-size: var(--fs-sm); line-height: 1.45; color: var(--text-3); }
.pfe-block.is-off { background: none; }
.pfe-block.is-off .pfe-block__name { color: var(--text-3); }
.pfe-block__move { display: flex; flex: none; gap: 2px; }
.pfe-count { flex: none; padding: 2px 9px; border-radius: var(--r-pill); background: var(--bg-active); font-size: var(--fs-sm); color: var(--text-2); white-space: nowrap; }
.pfe-fav, .pfe-result { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 7px 8px; border: 1px solid var(--border); border-radius: var(--r-inner); background: var(--bg-raised); }
.pfe-result { border-style: dashed; background: none; }
.pfe-fav__n { flex: none; width: 14px; text-align: center; font-size: var(--fs-sm); color: var(--text-4); }
.pfe-thumb { flex: none; width: 60px; }
.pfe-game__text { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.pfe-game__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-md); font-weight: 600; }
.pfe-game__sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); color: var(--text-3); }
.pfe-fav.is-gone .pfe-game__sub { white-space: normal; color: var(--amber-text); }

/* ---------- the live preview and the save bar ---------- */
.pfe-side { position: sticky; top: 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pfe-preview__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; }
.pfe-preview__title { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-sm); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.pfe-preview__title svg { align-self: center; }
.pfe-preview { max-height: calc(100vh - 200px); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; border-radius: 18px; scrollbar-width: thin; }
.pfe.has-bar .pfe-preview { max-height: calc(100vh - 274px); }            /* the save bar at the bottom must not cover the end of the preview */
.pfe-preview__box { min-width: 0; }
.pfe-bar { position: sticky; bottom: 12px; z-index: var(--z-sticky); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 11px 12px 11px 18px; border: 1px solid var(--accent-ring); border-radius: 14px; background: var(--bg-popover); box-shadow: var(--shadow-lg); }
.pfe-bar[hidden] { display: none; }
.pfe-bar.has-error { border-color: var(--red-border); }
.pfe-bar.has-error .pfe-bar__text { color: var(--red-text); }
.pfe-bar__text { flex: 1 1 200px; min-width: 0; font-size: var(--fs-md); font-weight: 500; overflow-wrap: anywhere; }
.pfe-bar__actions { display: flex; flex: none; gap: 8px; margin-left: auto; }

@container pfe (max-width: 859px) {
  .pfe-tabs { display: inline-flex; }
  .pfe-grid { grid-template-columns: minmax(0, 1fr); }
  .pfe-side { position: static; }
  .pfe-preview { max-height: none; overflow: visible; }
  .pfe[data-tab="edit"] .pfe-side { display: none; }
  .pfe[data-tab="preview"] .pfe-form { display: none; }
}
@media (max-width: 719px) {
  .pfe-skel { grid-template-columns: minmax(0, 1fr); }
  .pfe-card { padding: 14px 13px 15px; }
  .pfe-grid-avatar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pfe-tabs { align-self: stretch; display: flex; }
  .pfe-tabs > * { flex: 1; }
  .pfe-block { gap: 9px; padding: 9px 4px 9px 10px; }
  .pfe-thumb { width: 52px; }
  .pfe-bar { bottom: 8px; padding: 10px 10px 10px 14px; }
}
