/* Profile studio: editor, public profile card, profile backgrounds and the fragrance timeline.
   Loaded last so these components have one source of truth. */

/* ---------- Profile backgrounds: soft mesh gradients with a fine grain ---------- */
.pp-backdrop {
  --bd-a: #eef5ef; --bd-b: #d5e8dc; --bd-1: #b5dcc4; --bd-2: #f4ecd0; --bd-3: #8cc5a6; --bd-glow: #ffffff; --bd-glow-strength: 55%;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(65% 85% at 8% 10%, var(--bd-1) 0%, transparent 62%),
    radial-gradient(55% 70% at 94% 6%, var(--bd-2) 0%, transparent 60%),
    radial-gradient(80% 95% at 78% 110%, var(--bd-3) 0%, transparent 64%),
    linear-gradient(140deg, var(--bd-a), var(--bd-b));
}
.pp-backdrop::before {
  content: "";
  position: absolute;
  inset: -30%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(32% 32% at 30% 68%, color-mix(in srgb, var(--bd-glow) var(--bd-glow-strength), transparent), transparent 70%),
    radial-gradient(28% 28% at 72% 34%, color-mix(in srgb, var(--bd-2) 75%, transparent), transparent 70%);
  filter: blur(14px);
  opacity: .8;
}
.pp-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .2;
  mix-blend-mode: soft-light;
}
.pp-backdrop[data-backdrop=garden]   { --bd-a: #eef5ef; --bd-b: #d5e8dc; --bd-1: #b5dcc4; --bd-2: #f4ecd0; --bd-3: #8cc5a6; }
.pp-backdrop[data-backdrop=bloom]    { --bd-a: #fdf1f2; --bd-b: #f8dbe2; --bd-1: #f6bccb; --bd-2: #ffe2c9; --bd-3: #e89cb4; }
.pp-backdrop[data-backdrop=coast]    { --bd-a: #ebf6f8; --bd-b: #d0e9f0; --bd-1: #a7dbe6; --bd-2: #e0e5ff; --bd-3: #74bfd3; }
.pp-backdrop[data-backdrop=dusk]     { --bd-a: #fdf2e5; --bd-b: #f8dcc1; --bd-1: #f5c091; --bd-2: #f6cbc5; --bd-3: #e59b66; --bd-glow: #fff4e6; }
.pp-backdrop[data-backdrop=twilight] { --bd-a: #f4f0fc; --bd-b: #e3daf6; --bd-1: #ccb9f0; --bd-2: #f5d4ea; --bd-3: #aa8ddd; }
.pp-backdrop[data-backdrop=desert]   { --bd-a: #f9f2e9; --bd-b: #eddcc8; --bd-1: #e5c7a4; --bd-2: #f6e5d0; --bd-3: #c9a077; --bd-glow: #fffaf2; }
.pp-backdrop[data-backdrop=snow]     { --bd-a: #f7f8fa; --bd-b: #e7ebf1; --bd-1: #dde4ed; --bd-2: #f0e8f4; --bd-3: #ccd6e3; }
.pp-backdrop[data-backdrop=forest]   { --bd-a: #13241e; --bd-b: #1c382d; --bd-1: #2f6b55; --bd-2: #4f7f5c; --bd-3: #1f5a46; --bd-glow: #b9dcae; --bd-glow-strength: 22%; }
.pp-backdrop[data-backdrop=aurora]   { --bd-a: #0b1026; --bd-b: #131b3f; --bd-1: #1f8f8a; --bd-2: #6a4fc6; --bd-3: #2a5fb8; --bd-glow: #7ff0d8; --bd-glow-strength: 26%; }
.pp-backdrop[data-backdrop=rain]     { --bd-a: #1b1d22; --bd-b: #2a2d34; --bd-1: #3c414b; --bd-2: #5a606e; --bd-3: #30343c; --bd-glow: #9aa3b5; --bd-glow-strength: 18%; }
@media (prefers-reduced-motion: no-preference) {
  body:not([data-motion=off]) :is(.profile-preview-stage, .public-profile-cover).pp-backdrop::before { animation: pp-drift 24s ease-in-out infinite alternate; }
}
@keyframes pp-drift { from { transform: translate3d(-5%, 3%, 0) scale(1); } to { transform: translate3d(5%, -4%, 0) scale(1.08); } }

/* ---------- Shared controls ---------- */
.pe-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--bg-card); color: var(--ink);
  font: inherit; font-size: 13px; font-weight: 600; line-height: 1.2; white-space: nowrap;
  box-shadow: 0 1px 2px var(--shadow);
  cursor: pointer;
  transition: background-color .15s var(--ease-out), border-color .15s var(--ease-out), color .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.pe-button:hover:not(:disabled) { background: var(--tint); border-color: color-mix(in srgb, var(--accent-color) 45%, var(--line)); }
.pe-button:active:not(:disabled) { translate: 0 1px; }
.pe-button svg { width: 17px; height: 17px; flex-shrink: 0; }
.pe-button-quiet { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.pe-button-quiet:hover:not(:disabled) { background: var(--soft); border-color: transparent; color: var(--ink); }
.pe-kicker { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pe-kicker svg { width: 16px; height: 16px; }
#profile-status:empty { display: none; }

/* ---------- Edit profile layout ---------- */
#account-edit-view .profile-editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 24px; align-items: start; }
#account-edit-view .profile-editor-forms { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.pe-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin: 0; min-width: 0; }
.pe-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; min-width: 0; padding: 22px 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg-card); color: var(--text); box-shadow: 0 1px 2px var(--shadow); }
.pe-card-head { display: grid; gap: 3px; }
.pe-card-title { margin: 0; font: 600 15px/1.35 Inter, system-ui, sans-serif; letter-spacing: -.01em; color: var(--ink); }
.pe-help { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }

/* Fields */
.pe-field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; margin: 0; }
.pe-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pe-label { font-size: 13px; font-weight: 600; line-height: 1.3; letter-spacing: -.005em; color: var(--ink); }
.pe-optional, .pe-count { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pe-count[data-near=true] { color: var(--amber); }
.pe-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pe-control { position: relative; display: block; min-width: 0; }
.pe-control > .pe-icon { position: absolute; inset-inline-start: 14px; top: 23px; translate: 0 -50%; width: 18px; height: 18px; color: var(--muted); pointer-events: none; transition: color .15s var(--ease-out); }
.pe-control:focus-within > .pe-icon { color: var(--accent-color); }
.pe-input {
  appearance: none; -webkit-appearance: none;
  display: block; width: 100%; min-height: 46px; box-sizing: border-box; margin: 0;
  padding: 11px 14px;
  border: 1px solid color-mix(in srgb, var(--control-line) 22%, var(--line)); border-radius: 12px;
  background: color-mix(in srgb, var(--ink) 2.5%, var(--bg-card)); color: var(--ink);
  font: inherit; font-size: 14.5px; line-height: 1.45; letter-spacing: 0;
  box-shadow: inset 0 1px 2px color-mix(in srgb, var(--ink) 5%, transparent);
  outline: none;
  transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out), background-color .15s var(--ease-out);
}
.pe-control > .pe-input { padding-inline-start: 42px; }
.pe-input::placeholder { color: color-mix(in srgb, var(--muted) 72%, transparent); opacity: 1; }
.pe-input:hover { border-color: color-mix(in srgb, var(--control-line) 50%, var(--line)); }
.pe-input:focus, .pe-input:focus-visible { outline: none; border-color: var(--accent-color); background: var(--bg-card); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-color) 16%, transparent); }
.pe-input[aria-invalid=true] { border-color: var(--red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 13%, transparent); }
.pe-input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }
.pe-textarea { min-height: 116px; padding-block: 12px; resize: vertical; }
.pe-error { margin: 0; font-size: 12px; line-height: 1.45; color: var(--red); }
.pe-empty { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.pe-clear { position: absolute; inset-inline-end: 7px; top: 23px; translate: 0 -50%; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; }
.pe-clear:hover { background: var(--soft); color: var(--ink); }
.pe-clear svg { width: 16px; height: 16px; }
.pe-picker .pe-input { padding-inline-end: 44px; }
[dir=rtl] #profile-website { direction: ltr; text-align: left; padding-left: 14px; padding-right: 42px; }

/* Signature fragrance picker */
.pe-picker.photo-scent-picker { position: static; }
.pe-picker .pe-control .photo-picker-results { top: calc(100% + 6px); max-height: 320px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-card); box-shadow: var(--shadow-panel); }
.pe-picker .photo-picker-results > button { border-radius: 10px; padding: 8px 10px; }
.pe-picker .photo-picker-results > button:hover, .pe-picker .photo-picker-results > button[aria-selected=true] { background: var(--tint); border-color: transparent; }
/* The live preview already shows the chosen bottle, so the picker's own selection card would repeat it. */
.pe-picker .photo-picker-selection { display: none !important; }

/* Notes */
.pe-chips, .pe-suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
.pe-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg-card); color: var(--ink);
  font: inherit; font-size: 13px; font-weight: 500; line-height: 1; cursor: pointer;
  transition: background-color .15s var(--ease-out), border-color .15s var(--ease-out), color .15s var(--ease-out);
}
.pe-chip:hover:not(:disabled) { background: var(--tint); border-color: color-mix(in srgb, var(--accent-color) 45%, var(--line)); }
.pe-chip:disabled { opacity: .45; }
.pe-chip-icon { width: 14px; height: 14px; color: var(--muted); flex-shrink: 0; }
.pe-chip-on { background: color-mix(in srgb, var(--accent-color) 11%, var(--bg-card)); border-color: color-mix(in srgb, var(--accent-color) 38%, var(--line)); padding-inline-end: 9px; }
.pe-chip-on .pe-chip-icon { color: var(--accent-color); }
.pe-chip-on:hover:not(:disabled) { background: color-mix(in srgb, var(--red) 9%, var(--bg-card)); border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }
.pe-chip-on:hover .pe-chip-icon { color: var(--red); }
.pe-suggestions .pe-empty { flex-basis: 100%; }

/* Medal row */
.pe-medal-row { display: flex; align-items: center; gap: 14px; padding: 12px 12px 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); }
.pe-medal-art { display: grid; place-items: center; flex-shrink: 0; width: 40px; height: 44px; color: var(--accent-color); }
.pe-medal-art > .pe-icon { width: 24px; height: 24px; }
.pe-medal-art .pinned-medal-badge, .pe-medal-art .medal-mini { width: 34px; height: 40px; margin: 0; }
.pe-medal-row > div { display: grid; gap: 2px; flex: 1; min-width: 0; }
.pe-medal-row > div > strong { font-size: 13px; font-weight: 600; color: var(--ink); }
.pe-medal-row > div > span { font-size: 12px; line-height: 1.45; color: var(--muted); }

/* Photo */
.pe-photo-card .profile-photo-editor { display: flex; align-items: center; gap: 20px; }
.pe-avatar { position: relative; flex-shrink: 0; border-radius: 50%; cursor: pointer; }
.pe-avatar .profile-avatar { width: 84px; height: 84px; font-size: 32px; border: 3px solid var(--bg-card); box-shadow: 0 0 0 1px var(--line), 0 6px 18px var(--shadow); background: var(--tint); transition: filter .15s var(--ease-out), opacity .2s; }
.pe-avatar:hover .profile-avatar { filter: brightness(.94); }
.pe-avatar-badge { position: absolute; inset-inline-end: -2px; bottom: -2px; display: grid; place-items: center; width: 30px; height: 30px; border: 3px solid var(--bg-card); border-radius: 50%; background: var(--accent-color); color: var(--on-accent); }
.pe-avatar-badge svg { width: 14px; height: 14px; }
.pe-avatar[data-busy=true] .profile-avatar { opacity: .5; }
.pe-avatar[data-busy=true]::after { content: ""; position: absolute; inset: 26px; border: 3px solid color-mix(in srgb, var(--accent-color) 25%, transparent); border-top-color: var(--accent-color); border-radius: 50%; animation: pe-spin .8s linear infinite; }
@keyframes pe-spin { to { rotate: 360deg; } }
#profile-photo-form { display: grid; gap: 4px; flex: 1; min-width: 0; margin: 0; }
.pe-photo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.pe-button.profile-upload-button { position: relative; overflow: hidden; }
.pe-button.profile-upload-button input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pe-button.profile-upload-button:focus-within { outline: 2px solid var(--focus); outline-offset: 3px; }
#profile-photo-form[data-busy=true] .profile-upload-button { pointer-events: none; opacity: .6; }
.pe-status { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.pe-status:empty { display: none; }

/* Backgrounds picker */
.pe-backdrops { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px 12px; min-width: 0; margin: 0; padding: 0; border: 0; }
.pe-backdrop-option { position: relative; display: grid; gap: 7px; min-width: 0; cursor: pointer; }
.pe-backdrop-option input { position: absolute; inset: 0; z-index: 2; margin: 0; opacity: 0; cursor: pointer; }
.pe-swatch { display: block; aspect-ratio: 4 / 3; border-radius: 12px; box-shadow: inset 0 0 0 1px color-mix(in srgb, #000 9%, transparent); transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out); }
.pe-backdrop-option:hover .pe-swatch { transform: translateY(-2px); }
.pe-backdrop-option input:checked + .pe-swatch { box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--accent-color); }
.pe-backdrop-option input:focus-visible + .pe-swatch { outline: 2px solid var(--focus); outline-offset: 6px; }
.pe-swatch-check { position: absolute; z-index: 1; top: 7px; inset-inline-end: 7px; width: 22px; height: 22px; padding: 4px; box-sizing: border-box; border-radius: 50%; background: var(--bg-card); color: var(--ink); stroke-width: 2.6; box-shadow: 0 2px 6px #0002; opacity: 0; transform: scale(.6); transition: opacity .15s, transform .18s var(--ease-out); }
.pe-backdrop-option input:checked + .pe-swatch .pe-swatch-check { opacity: 1; transform: none; }
.pe-swatch-label { font-size: 12px; font-weight: 500; text-align: center; color: var(--muted); }
.pe-backdrop-option input:checked ~ .pe-swatch-label { font-weight: 600; color: var(--ink); }

/* Save bar */
.pe-savebar {
  position: sticky; bottom: 14px; z-index: 6;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 10px 10px 10px 18px;
  border: 1px solid var(--line); border-radius: 16px;
  background: color-mix(in srgb, var(--bg-card) 88%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 10px 30px var(--shadow-float);
}
.pe-save-state { display: flex; align-items: center; gap: 9px; min-width: 0; margin: 0; font-size: 13px; color: var(--muted); }
.pe-save-state::before { content: ""; flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--positive); }
.pe-savebar[data-dirty=true] .pe-save-state { color: var(--ink); }
.pe-savebar[data-dirty=true] .pe-save-state::before { background: var(--amber); box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 18%, transparent); }
.pe-save-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.pe-savebar .primary { min-height: 42px; padding: 9px 20px; border-radius: 11px; }

/* Live preview column */
#account-edit-view .profile-live-preview { position: sticky; top: 76px; display: grid; gap: 12px; padding: 0; }
.pe-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pe-live-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); }
.pe-live-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--positive); box-shadow: 0 0 0 3px color-mix(in srgb, var(--positive) 20%, transparent); }
.pe-privacy { display: flex; align-items: flex-start; gap: 9px; margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.pe-privacy svg { flex-shrink: 0; width: 16px; height: 16px; margin-top: 1px; }

/* ---------- Public profile card (live preview, public preview and member dialog) ---------- */
.public-profile { --profile-accent: #5f9e7f; position: relative; max-width: none; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--bg-card); color: var(--text); box-shadow: 0 1px 2px var(--shadow), 0 12px 32px var(--shadow); }
.public-profile .public-profile-cover { height: 118px; border-radius: 0; }
.public-profile .public-profile-body { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 0 22px 22px; }
.public-profile .public-profile-identity { display: grid; grid-template-columns: 1fr; gap: 10px; justify-items: start; align-items: start; }
.public-profile .profile-avatar { position: relative; width: 84px; height: 84px; margin-top: -42px; font-size: 32px; border: 4px solid var(--bg-card); box-shadow: 0 6px 18px var(--shadow); background: color-mix(in srgb, var(--profile-accent) 18%, var(--bg-card)); }
.public-profile .public-profile-identity-copy { display: grid; gap: 3px; min-width: 0; width: 100%; }
.public-profile .profile-member-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.public-profile .profile-member-heading h2 { margin: 0; font: 400 26px/1.15 var(--studio-serif); letter-spacing: -.4px; color: var(--ink); overflow-wrap: anywhere; }
.public-profile .profile-member-heading .pinned-medal-badge, .public-profile .profile-member-heading .medal-mini { width: 28px; height: 33px; margin: 0; }
.public-profile .profile-member-id { margin: 0; font-size: 12px; letter-spacing: .02em; color: var(--muted); }
.public-profile .profile-bio { margin: 0; padding: 0; border: 0; background: none; font-size: 14px; line-height: 1.65; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.public-profile .profile-empty-bio { margin: 0; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 12px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.public-profile .profile-public-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--muted); }
.public-profile .profile-public-meta li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; margin: 0; }
.public-profile .profile-public-meta .pe-icon { flex-shrink: 0; width: 15px; height: 15px; }
.public-profile .profile-public-meta a { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--ink); text-decoration: none; }
.public-profile .profile-public-meta a:hover span { text-decoration: underline; text-underline-offset: 3px; }
.public-profile .profile-public-meta span { overflow-wrap: anywhere; }
.public-profile section { display: grid; gap: 10px; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--line); }
.public-profile h3 { margin: 0; font: 600 11px/1.4 Inter, system-ui, sans-serif; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.public-profile .note-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.public-profile .note-chip { min-height: 30px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-card); font-size: 12.5px; }
.public-profile .profile-signature-card { display: flex; align-items: center; gap: 14px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--profile-accent) 7%, var(--bg-card)); }
.public-profile .profile-signature .catalog-art.product-photo { flex-shrink: 0; width: 60px; height: 72px; max-width: none; margin: 0; padding: 6px; border-radius: 10px; background: var(--photo-bg, #f8f7f4); }
.public-profile .profile-signature .product-photo img { width: 100%; height: 100%; object-fit: contain; }
.public-profile .profile-signature :is(.photo-count, .photo-family) { display: none; }
.public-profile .profile-signature-copy { display: grid; gap: 2px; min-width: 0; }
.public-profile .profile-signature .text-button { padding: 0; font: 400 18px/1.25 var(--studio-serif); text-align: start; white-space: normal; color: var(--ink); }
.public-profile .profile-signature-copy > span { font-size: 12px; color: var(--muted); }

/* ---------- Public preview ---------- */
.pp-preview-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 0 16px; }
.pp-preview-bar h2 { margin: 6px 0 4px; font: 400 28px/1.15 var(--studio-serif); letter-spacing: -.4px; color: var(--ink); }
.pp-preview-bar p { margin: 0; font-size: 13px; color: var(--muted); }
#account-preview-view .profile-preview-stage { display: grid; justify-items: center; min-height: 0; padding: clamp(28px, 6vw, 60px) clamp(14px, 4vw, 48px); border: 1px solid var(--line); border-radius: 22px; }
#account-preview-view #profile-public-card { position: relative; z-index: 1; width: min(100%, 600px); }
#account-preview-view .public-profile { overflow: visible; border: 0; background: transparent; box-shadow: none; }
#account-preview-view .public-profile-cover { display: none; }
#account-preview-view .public-profile .public-profile-body { margin-top: 48px; padding: 0 28px 26px; border: 1px solid color-mix(in srgb, #fff 45%, var(--line)); border-radius: 22px; background: color-mix(in srgb, var(--bg-card) 94%, transparent); -webkit-backdrop-filter: blur(20px) saturate(1.3); backdrop-filter: blur(20px) saturate(1.3); box-shadow: 0 24px 60px #0000002a; }
#account-preview-view .public-profile .profile-avatar { width: 96px; height: 96px; margin-top: -48px; font-size: 36px; }
#account-preview-view .public-profile .profile-member-heading h2 { font-size: 30px; }
.public-member-dialog .public-profile { box-shadow: none; }

/* ---------- Fragrance timeline ---------- */
#account-timeline-view:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.tl-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.tl-head .eyebrow { margin: 0; font-size: 10px; letter-spacing: .16em; }
.tl-head h2 { margin: 6px 0 4px; font: 400 30px/1.15 var(--studio-serif); letter-spacing: -.5px; color: var(--ink); }
.tl-head p { margin: 0; font-size: 13px; color: var(--muted); }
.tl-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-card); }
.tl-stats > div { display: grid; gap: 2px; min-width: 0; padding: 16px 18px; border-inline-start: 1px solid var(--line); }
.tl-stats > div:first-child { border-inline-start: 0; }
.tl-stats span { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tl-stats strong { font: 400 26px/1.25 var(--studio-serif); color: var(--ink); font-variant-numeric: tabular-nums; }
.tl-stats small { font-size: 11.5px; color: var(--muted); }
.tl-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: start; }
.tl-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.tl-toolbar { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.tl-filters { display: inline-flex; max-width: 100%; min-width: 0; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.tl-filters button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 6px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; transition: background-color .15s, color .15s; }
.tl-filters button:hover { color: var(--ink); }
.tl-filters button span { padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 7%, transparent); font-size: 11px; font-variant-numeric: tabular-nums; }
.tl-filters button[aria-pressed=true] { background: var(--bg-card); color: var(--ink); box-shadow: 0 1px 3px var(--shadow), 0 0 0 1px var(--line); }
.tl-note-filter { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 5px 9px 5px 12px; border: 1px solid color-mix(in srgb, var(--accent-color) 40%, var(--line)); border-radius: 999px; background: var(--tint); color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; }
.tl-note-filter svg { width: 14px; height: 14px; }
.tl-list, .tl-list ol { margin: 0; padding: 0; list-style: none; }
.tl-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.tl-month h4 { margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tl-month > ol { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding-inline-start: 42px; }
.tl-month > ol::before { content: ""; position: absolute; inset-block: 18px; inset-inline-start: 14px; width: 2px; border-radius: 2px; background: var(--line); }
.tl-entry { position: relative; }
.tl-dot { position: absolute; z-index: 1; inset-inline-start: -42px; top: 50%; translate: 0 -50%; display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%; background: var(--bg-card); color: var(--muted); }
.tl-dot svg { width: 15px; height: 15px; }
.tl-entry[data-kind=collection] .tl-dot { border-color: color-mix(in srgb, var(--accent-color) 40%, var(--line)); background: var(--tint); color: var(--accent-color); }
.tl-entry[data-kind=wishlist] .tl-dot { color: var(--tone-rose); }
.tl-entry[data-kind=rating] .tl-dot { color: var(--amber); }
.tl-entry-card { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 10px 14px 10px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-card); transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out); }
.tl-entry-card:hover { border-color: color-mix(in srgb, var(--accent-color) 35%, var(--line)); box-shadow: 0 4px 14px var(--shadow); }
.tl-photo { display: grid; place-items: center; width: 52px; height: 60px; padding: 4px; overflow: hidden; border: 0; border-radius: 10px; background: var(--photo-bg, #f8f7f4); color: var(--muted); cursor: pointer; }
.tl-photo img { width: 100%; height: 100%; object-fit: contain; }
.tl-entry-copy { display: grid; justify-items: start; gap: 3px; min-width: 0; }
.tl-name { padding: 0; border: 0; background: none; font: 400 16px/1.3 var(--studio-serif); text-align: start; color: var(--ink); overflow-wrap: anywhere; cursor: pointer; }
.tl-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.tl-brand { font-size: 12px; color: var(--muted); }
.tl-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.tl-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--soft); color: var(--text); font-size: 11.5px; font-weight: 500; line-height: 1.4; }
.tl-tag svg { width: 12px; height: 12px; }
.tl-tag[data-kind=collection] { border-color: color-mix(in srgb, var(--accent-color) 30%, var(--line)); background: var(--tint); }
.tl-tag[data-kind=wishlist] { border-color: color-mix(in srgb, var(--tone-rose) 30%, var(--line)); background: color-mix(in srgb, var(--tone-rose) 9%, var(--bg-card)); }
.tl-tag[data-kind=rating] { border-color: transparent; background: var(--amber-bg); color: var(--amber); }
.tl-observed { font-size: 11px; color: var(--muted); text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }
.tl-entry-card time { align-self: start; padding-top: 3px; font-size: 12px; white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-more { justify-self: center; }
.tl-foot { margin: 0; font-size: 12px; line-height: 1.6; color: var(--muted); }
.tl-empty { display: grid; justify-items: center; gap: 8px; padding: 40px 20px; border: 1px dashed var(--line); border-radius: 16px; background: var(--soft); text-align: center; }
.tl-empty strong { font: 400 20px/1.3 var(--studio-serif); color: var(--ink); }
.tl-empty p { max-width: 380px; margin: 0; font-size: 13px; line-height: 1.55; color: var(--muted); }
.tl-empty .primary { margin-top: 6px; }
.tl-side { position: sticky; top: 76px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.tl-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-card); }
.tl-card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 10px; }
.tl-card h3 { margin: 0; font: 600 14px/1.3 Inter, system-ui, sans-serif; color: var(--ink); }
.tl-legend, .tl-hint { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.tl-legend i { width: 8px; height: 8px; margin-inline-start: 6px; border-radius: 2px; }
.tl-legend i:first-child { margin-inline-start: 0; }
:is(.tl-legend, .tl-family-bar) .is-collection { background: var(--accent-color); }
:is(.tl-legend, .tl-family-bar) .is-wishlist { background: color-mix(in srgb, var(--accent-color) 32%, var(--bg-card)); }
#timeline-families { display: grid; gap: 10px; }
.tl-family { display: grid; grid-template-columns: minmax(0, 90px) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 12.5px; }
.tl-family-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.tl-family-bar { display: flex; height: 8px; overflow: hidden; border-radius: 999px; background: var(--soft); }
.tl-family-bar i { display: block; height: 100%; }
.tl-family-count { font-size: 12px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.tl-family-count small { font-weight: 400; color: var(--muted); }
.tl-notes { display: flex; flex-wrap: wrap; gap: 6px; }
.tl-notes button { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-card); color: var(--ink); font: inherit; font-size: 12.5px; cursor: pointer; transition: background-color .15s, border-color .15s; }
.tl-notes button:hover { border-color: color-mix(in srgb, var(--accent-color) 45%, var(--line)); background: var(--tint); }
.tl-notes button span { font-size: 11px; color: var(--muted); }
.tl-notes button[aria-pressed=true] { border-color: var(--accent-color); background: var(--accent-color); color: var(--on-accent); }
.tl-notes button[aria-pressed=true] span { color: inherit; opacity: .8; }
.tl-empty-copy { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 850px) {
  #account-edit-view .profile-editor-layout { grid-template-columns: 1fr; }
  #account-edit-view .profile-live-preview { position: static; max-width: 560px; }
  .tl-layout { grid-template-columns: minmax(0, 1fr); }
  .tl-side { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (max-width: 600px) {
  #account-hub .account-view-switch { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
  #account-hub .account-view-switch::-webkit-scrollbar { display: none; }
  #account-hub .account-view-switch button { flex: 0 0 auto; padding-inline: 12px; }
  .pe-card { padding: 18px 16px; border-radius: 16px; }
  .pe-grid { grid-template-columns: 1fr; }
  .pe-input { font-size: 16px; }
  .pe-photo-card .profile-photo-editor { align-items: flex-start; gap: 16px; }
  .pe-avatar .profile-avatar { width: 72px; height: 72px; font-size: 28px; }
  .pe-avatar[data-busy=true]::after { inset: 20px; }
  .pe-backdrops { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pe-medal-row { flex-wrap: wrap; }
  .pe-medal-row .pe-button { width: 100%; }
  .pe-savebar { bottom: 8px; flex-wrap: wrap; padding: 10px 12px; }
  .pe-save-actions { width: 100%; }
  .pe-save-actions .primary { flex: 1; }
  .pp-preview-bar { flex-direction: column; align-items: flex-start; }
  #account-preview-view .public-profile .public-profile-body { padding: 0 18px 20px; }
  .tl-head { flex-direction: column; align-items: flex-start; }
  .tl-head h2 { font-size: 26px; }
  .tl-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tl-stats > div { padding: 14px; }
  .tl-stats > div:nth-child(3) { border-inline-start: 0; }
  .tl-stats > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .tl-stats strong { font-size: 22px; }
  .tl-filters { display: flex; width: 100%; overflow-x: auto; }
  .tl-filters button { flex: 1 0 auto; padding-inline: 10px; }
  .tl-side { grid-template-columns: minmax(0, 1fr); }
  .tl-month > ol { padding-inline-start: 34px; }
  .tl-month > ol::before { inset-inline-start: 11px; }
  .tl-dot { inset-inline-start: -34px; width: 24px; height: 24px; }
  .tl-dot svg { width: 13px; height: 13px; }
  .tl-entry-card { grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 10px; }
  .tl-entry-card time { position: absolute; top: 10px; inset-inline-end: 12px; padding: 0; font-size: 11px; }
  .tl-entry-copy { padding-inline-end: 44px; }
  .tl-photo { width: 44px; height: 52px; }
}
