/* Profile inside the app shell (Phase 4, design doc §6). */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Desktop nav: the app's top bar */
.ps-nav { display: none; align-items: center; gap: 4px; }
.ps-nav:not([hidden]) { display: flex; }
.ps-link { padding: 7px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--text-muted); text-decoration: none; }
.ps-link:hover { background: var(--surface-2); color: var(--text); }
.ps-link[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--divider); }
.ps-add-btn { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; padding: 8px 14px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; }
.ps-link:focus-visible, .ps-add-btn:focus-visible, .ps-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Mobile tab bar — same shape as the app's */
.ps-tabbar { display: none; }
@media (max-width: 767px) {
  .ps-nav:not([hidden]) { display: none; }
  .ps-tabbar:not([hidden]) {
    position: fixed; z-index: 50; left: 50%; transform: translateX(-50%);
    bottom: calc(12px + env(safe-area-inset-bottom));
    display: grid; grid-template-columns: repeat(3, 1fr); align-items: center; gap: 6px;
    width: min(360px, calc(100vw - 32px)); padding: 6px; border-radius: 26px;
    background: var(--glass); -webkit-backdrop-filter: saturate(1.8) blur(24px); backdrop-filter: saturate(1.8) blur(24px);
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--divider);
  }
}
.ps-tab { display: grid; justify-items: center; gap: 2px; padding: 6px 0; border-radius: 20px; font-size: 11px; font-weight: 600; color: var(--text-muted); text-decoration: none; }
.ps-tab[aria-current="page"] { color: var(--text); background: var(--surface); box-shadow: var(--shadow-sm); }
.ps-tab-add { place-items: center; }
.ps-add-dot { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.16), 0 1px 2px rgba(0,0,0,.08); }

/* Signed-out visitors: one "Make your own" bar instead of the tab bar */
.ps-make { display: none; }
.ps-make:not([hidden]) {
  position: fixed; z-index: 50; left: 50%; transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: min(560px, calc(100vw - 24px)); padding: 10px 10px 10px 18px; border-radius: 22px;
  background: var(--glass); -webkit-backdrop-filter: saturate(1.8) blur(24px); backdrop-filter: saturate(1.8) blur(24px);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--divider);
}
.ps-make p { margin: 0; font-size: 14px; line-height: 1.3; color: var(--text); }
.ps-make .p-btn { flex: none; margin: 0; }
@media (max-width: 420px) { .ps-make p span { display: none; } }

/* Owner bar + preview */
.p-owner { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.p-owner[hidden], .p-actions[hidden], #makeOwnBtn[hidden] { display: none; }
.p-btn--ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--divider); color: var(--text); }
.p-preview-pill {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: fit-content; max-width: 100%;
  margin: 4px auto 0; padding: 6px 6px 6px 14px; border-radius: 999px; white-space: nowrap;
  background: var(--text); color: var(--bg); font-size: 13px; font-weight: 600; box-shadow: var(--shadow-md);
}
.p-preview-pill .p-btn { padding: 6px 12px; min-height: 0; font-size: 13px; background: var(--bg); color: var(--text); }
.p-tagline--auto { color: var(--text-muted); }
/* Keep the toast above the bottom bars */
.toast { bottom: calc(96px + env(safe-area-inset-bottom)) !important; z-index: 70; }

/* Phase 6: the floating bar never covers the end of the page (size set by u.html). */
body { padding-bottom: var(--bar-clear, 0px); }

/* Header avatar → Settings, same as the app's header (owner and signed-in visitors). */
.ps-avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; overflow: hidden;
  margin-left: 12px; background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--divider);
  font: 600 13px/1 inherit; letter-spacing: 0.02em; text-decoration: none; }
.ps-avatar[hidden] { display: none; }
.ps-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ps-avatar:hover { box-shadow: inset 0 0 0 1px var(--text-muted); }
.ps-avatar:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.topbar .ps-nav:not([hidden]) { margin-left: auto; }
.topbar .ps-nav[hidden] + .topbar-cta[hidden] + .ps-avatar { margin-left: auto; }

/* Settings sheet (profile page) */
.ps-sheet { position: fixed; inset: 0; z-index: 90; display: grid; align-items: end; justify-items: center; }
.ps-sheet[hidden] { display: none; }
.ps-sheet-backdrop { position: absolute; inset: 0; background: rgba(20, 14, 8, 0.38); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.ps-sheet-card { position: relative; width: min(420px, 100%); margin: 0 0 env(safe-area-inset-bottom); padding: 20px; border-radius: 24px 24px 0 0;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 18px; }
@media (min-width: 768px) { .ps-sheet { align-items: center; } .ps-sheet-card { border-radius: 24px; } }
.ps-set-head { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--divider); }
.ps-set-who { flex: 1; min-width: 0; }
.ps-set-name { margin: 0; font-weight: 600; font-size: 16px; }
.ps-set-email { margin: 2px 0 0; color: var(--text-muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.ps-set-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.ps-set-theme { border: 0; margin: 0; padding: 0; min-width: 0; }
.ps-set-label { padding: 0; margin-bottom: 8px; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.ps-seg { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--divider); }
.ps-seg label { position: relative; }
.ps-seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.ps-seg span { display: block; padding: 8px 10px; border-radius: 999px; text-align: center; font-size: 14px; color: var(--text-muted); }
.ps-seg input:checked + span { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 0 0 1px var(--divider); }
.ps-seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.ps-set-links { display: flex; flex-direction: column; }
.ps-set-link { display: flex; justify-content: space-between; align-items: center; padding: 12px 4px; border: 0; background: none; font: inherit; font-size: 15px; color: var(--text); text-decoration: none; text-align: left; cursor: pointer; border-top: 1px solid var(--divider); }
.ps-set-link:first-child { border-top: 0; }
.ps-set-out { color: var(--text-muted); }
.ps-set-close:focus-visible, .ps-set-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ps-avatar { border: 0; padding: 0; cursor: pointer; }

/* First-paint skeleton (profile) */
.p-skel { padding: 28px 0 0; }
.p-skel .sk { display: block; background: var(--surface-2); border-radius: 10px; animation: p-skel-pulse 1.4s ease-in-out infinite; }
.p-skel-hero { display: grid; justify-items: center; gap: 10px; padding-bottom: 24px; }
.sk-avatar { width: 96px; height: 96px; border-radius: 50% !important; margin-bottom: 6px; }
.sk-name { width: 180px; height: 28px; }
.sk-line { width: 240px; height: 14px; }
.sk-short { width: 150px; }
.p-skel-chips { display: flex; gap: 8px; overflow: hidden; padding: 8px 0 20px; }
.sk-chip { flex: none; width: 108px; height: 38px; border-radius: 999px !important; }
.p-skel-sec { display: grid; gap: 14px; }
.sk-h { width: 140px; height: 26px; }
.sk-feature { width: 100%; aspect-ratio: 4 / 5; max-height: 460px; border-radius: 22px !important; }
.p-skel-row { display: flex; align-items: center; gap: 14px; }
.sk-thumb { flex: none; width: 56px; height: 56px; border-radius: 14px !important; }
.p-skel-text { flex: 1; display: grid; gap: 8px; }
.sk-t1 { width: 60%; height: 15px; }
.sk-t2 { width: 40%; height: 12px; }
@keyframes p-skel-pulse { 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) { .p-skel .sk { animation: none; } }

/* Add: floating action above the tab bar (signed-in, mobile only) */
.ps-fab { display: none; }
@media (max-width: 767px) {
  .ps-fab:not([hidden]) {
    position: fixed; z-index: 51; right: 16px; bottom: calc(12px + env(safe-area-inset-bottom) + 64px + 14px);
    display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
    background: var(--accent); color: #fff; text-decoration: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22), 0 1px 3px rgba(0, 0, 0, 0.12);
  }
  .ps-fab:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
}
