/* Phos Editor · Home, loader, Home button and scene menu (v0.20)
   Built on the editor's Diffused layer: same glass, tokens, buttons and type. */
:root {
  --ph-mono: "Geist Mono", ui-monospace, monospace;
  --ph-sans: "Geist", system-ui, sans-serif;
  --ph-ink: #FFFFFF;
  --ph-sub: #A1A1AA;      /* ink-subtle, 7.8:1 on blackout */
  --ph-soft: #D4D4D8;
  --ph-line: rgba(255,255,255,0.09);
  --ph-ease: cubic-bezier(0.23, 1, 0.32, 1);
  --ph-glass: linear-gradient(180deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.03) 42%, rgba(255,255,255,0.05) 100%), rgba(10,10,11,0.55);
  --ph-glass-dense: linear-gradient(180deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.03) 42%, rgba(255,255,255,0.05) 100%), rgba(10,10,11,0.86);
  --ph-shadow: inset 0 0 0 1px rgba(255,255,255,0.09), 0 22px 44px -24px rgba(0,0,0,0.9);
}

/* ── Shell: Home covers the editor, which stays mounted underneath */
.ph-home { position: fixed; inset: 0; z-index: 50; overflow-y: auto; overflow-x: hidden; background: #050506; color: var(--ph-ink); font-family: var(--ph-sans); -webkit-font-smoothing: antialiased; }
.ph-home[hidden] { display: none; }
body.ph-at-home .app { visibility: hidden; }
.ph-home *, .ph-loader * { box-sizing: border-box; }
:where(.ph-home, .ph-toast, .ph-loader) :where(button, input) { font: inherit; color: inherit; }
:where(.ph-home) :where(button) { cursor: pointer; }
.ph-mono { font-family: var(--ph-mono); text-transform: uppercase; letter-spacing: 0.1em; font-size: 11px; }
.ph-muted { color: var(--ph-sub); }
.ph-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* background: blackout, warm Kelvin light low left (as in the editor), grid only near it */
.ph-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; background:
  radial-gradient(42% 46% at 0% 100%, rgba(226,53,28,0.20) 0%, rgba(255,90,31,0.10) 38%, rgba(255,90,31,0) 72%), #0A0A0B; }
.ph-bg::after { content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,214,180,0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,214,180,0.06) 1px, transparent 1px);
  background-size: 80px 80px;
  -webkit-mask: radial-gradient(45% 50% at 0% 100%, #000 0%, transparent 75%); mask: radial-gradient(45% 50% at 0% 100%, #000 0%, transparent 75%); }

/* glass, same recipe as the editor's panels */
.ph-glass { background: var(--ph-glass); -webkit-backdrop-filter: blur(28px) saturate(170%) contrast(1.06); backdrop-filter: blur(28px) saturate(170%) contrast(1.06); box-shadow: var(--ph-shadow); }

/* ── Buttons, like the editor: white main action that turns key on hover; glass ghost */
.ph-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 18px; border: 0; border-radius: 999px; font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: transform .16s var(--ph-ease), background-color .25s ease, color .2s var(--ph-ease), box-shadow .2s var(--ph-ease); }
.ph-btn:active { transform: scale(0.97); transition-duration: .1s; }
.ph-btn-sm { min-height: 34px; padding: 0 14px; font-size: 13px; }
.ph-btn-primary { background: #FFFFFF; color: #0A0A0B; }
.ph-btn-primary:active { background: #FF5A1F; }
.ph-btn-ghost { background: rgba(10,10,11,0.62); color: #FFFFFF; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18); }
.ph-quiet { color: var(--ph-sub); }
.ph-tag { font-size: 9px; color: var(--ph-sub); }
.ph-icon-btn { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 10px; display: grid; place-items: center; background: rgba(10,10,11,0.62); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18); transition: background-color .16s var(--ph-ease), transform .16s var(--ph-ease); }
.ph-icon-btn:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .ph-btn-primary:hover { background: #FF5A1F; color: #0A0A0B; }
  .ph-btn-ghost:hover, .ph-icon-btn:hover { background: rgba(255,255,255,0.10); }
}

/* ── Header: the editor's floating glass pill (landing HeaderBar) */
.ph-top { position: sticky; top: 12px; z-index: 6; display: flex; align-items: center; gap: 12px; width: calc(100% - 32px); max-width: 1280px; min-height: 60px; margin: 12px auto 0; padding: 8px 8px 8px 20px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(31,31,34,0.56) 0%, rgba(10,10,11,0.526) 55%, rgba(255,90,31,0) 100%); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.07);
  -webkit-backdrop-filter: blur(40px) saturate(170%); backdrop-filter: blur(40px) saturate(170%); }
.ph-top::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; padding: 1px; opacity: 0.55;
  background: radial-gradient(240px circle at 50% 0, rgba(255,242,228,0.95), rgba(255,150,90,0.55) 38%, rgba(255,255,255,0) 72%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.ph-brand { display: flex; align-items: center; gap: 8px; flex: none; }
.ph-wordmark { font-size: 26px; font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.ph-tag-l { padding-left: 8px; }
.ph-search { position: relative; flex: 1 1 240px; max-width: 460px; margin: 0 auto; height: 44px; padding: 0 16px; border-radius: 999px; display: flex; align-items: center; gap: 8px; color: var(--ph-sub);
  background: rgba(19,19,21,0.82); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.09); transition: box-shadow .16s var(--ph-ease); }
.ph-search:focus-within { box-shadow: inset 0 0 0 1px #FF5A1F, 0 0 0 4px rgba(255,90,31,0.16); }
.ph-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 14px; color: #fff; }
.ph-search input::placeholder { color: #71717A; }
.ph-search input::-webkit-search-cancel-button { filter: invert(1); opacity: 0.5; }
.ph-top-r { display: flex; align-items: center; gap: 10px; flex: none; }
.ph-tier { padding: 0 6px; color: #fff; }
.ph-top .ph-btn { min-height: 44px; padding: 0 20px; font-size: 15px; }
.ph-avatar { width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255,255,255,0.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18); font-size: 14px; font-weight: 600; }

/* ── Body: floating sidebar + content */
.ph-body { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px; max-width: 1280px; margin: 0 auto; padding: 16px 16px 96px; }
.ph-side { position: sticky; top: 88px; flex: 1 1 220px; max-width: 256px; display: flex; flex-direction: column; gap: 22px; padding: 14px 10px; border-radius: 24px;
  background: var(--ph-glass); -webkit-backdrop-filter: blur(28px) saturate(170%); backdrop-filter: blur(28px) saturate(170%); box-shadow: var(--ph-shadow); }
.ph-side-group { display: flex; flex-direction: column; gap: 2px; }
.ph-side-head { display: flex; align-items: center; justify-content: space-between; padding: 0 10px 6px; }
.ph-pill-sm { font-size: 9px; padding: 3px 7px; border-radius: 999px; color: var(--ph-sub); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18); white-space: nowrap; }
.ph-nav { height: 38px; padding: 0 10px; border: 0; border-radius: 12px; background: transparent; display: flex; align-items: center; gap: 10px; font-size: 14px; text-align: left; color: var(--ph-soft); transition: background-color .16s var(--ph-ease); }
.ph-nav-ic { width: 18px; display: inline-grid; place-items: center; color: var(--ph-sub); }
.ph-nav-l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-count { font-size: 10px; color: var(--ph-sub); }
.ph-nav.on { background: rgba(255,255,255,0.08); color: #fff; font-weight: 500; }
.ph-nav.on .ph-nav-ic { color: #fff; }
.ph-nav.dim { color: var(--ph-sub); }
@media (hover: hover) and (pointer: fine) { .ph-nav:not(.on):hover { background: rgba(255,255,255,0.06); } }
.ph-plan { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 16px; background: rgba(19,19,21,0.82); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.09); }
.ph-meter { display: flex; flex-direction: column; gap: 6px; }
.ph-meter-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ph-soft); }
.ph-meter-row .ph-mono { font-size: 10px; }
.ph-meter-bar { height: 3px; border-radius: 2px; background: rgba(255,255,255,0.12); overflow: hidden; }
.ph-meter-bar i { display: block; height: 100%; background: #fff; border-radius: inherit; }

.ph-main { flex: 999 1 560px; min-width: 0; }
.ph-main-in { display: flex; flex-direction: column; gap: 22px; padding: 8px 4px 0; }

.ph-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 10px 10px 18px; border-radius: 20px; font-size: 14px; line-height: 20px; color: var(--ph-soft); }
.ph-banner > span { flex: 1 1 280px; }
.ph-banner > svg { color: var(--ph-sub); flex: none; }

.ph-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.ph-head-text { display: flex; flex-direction: column; gap: 6px; }
.ph-head h1 { margin: 0; font-size: 40px; line-height: 44px; font-weight: 600; letter-spacing: -0.035em; }
.ph-head p { margin: 2px 0 0; font-size: 14px; color: var(--ph-sub); }
.ph-head .ph-btn { padding-left: 14px; }

.ph-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.ph-seg { display: flex; gap: 2px; padding: 4px; border-radius: 18px; background: var(--ph-glass); box-shadow: var(--ph-shadow); -webkit-backdrop-filter: blur(28px); backdrop-filter: blur(28px); }
.ph-seg-btn { height: 38px; padding: 0 14px; border: 0; border-radius: 13px; display: inline-flex; align-items: center; gap: 8px; background: transparent; color: var(--ph-soft); font-size: 14px; font-weight: 500; transition: background-color .16s var(--ph-ease), color .16s var(--ph-ease); }
.ph-seg-btn .ph-mono { font-size: 10px; opacity: 0.75; }
.ph-seg-btn.on { background: #fff; color: #0A0A0B; box-shadow: 0 6px 18px -8px rgba(255,255,255,0.45); }
@media (hover: hover) and (pointer: fine) { .ph-seg-btn:not(.on):hover { background: rgba(255,255,255,0.07); } }
.ph-sort { display: flex; align-items: center; gap: 8px; }

/* chips: the editor's chip */
.ph-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ph-chip { padding: 6px 12px; border: 0; border-radius: 999px; font-family: var(--ph-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; background: rgba(10,10,11,0.62); color: var(--ph-soft); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18); transition: box-shadow .16s var(--ph-ease), background-color .16s var(--ph-ease), transform .16s var(--ph-ease); }
.ph-chip:active { transform: scale(0.97); }
.ph-chip.on { background: rgba(255,90,31,0.16); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,90,31,0.55); }
@media (hover: hover) and (pointer: fine) { .ph-chip:not(.on):hover { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.32); } }
.ph-usage { margin-left: auto; font-size: 10px; }

/* cards */
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.ph-card { position: relative; border-radius: 20px; background: var(--ph-glass); box-shadow: var(--ph-shadow); -webkit-backdrop-filter: blur(28px) saturate(170%); backdrop-filter: blur(28px) saturate(170%); transition: box-shadow .2s var(--ph-ease); }
.ph-card-main { width: 100%; padding: 8px; border: 0; border-radius: 20px; background: transparent; text-align: left; display: flex; flex-direction: column; gap: 12px; }
.ph-thumb { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: #0A0A0B; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  background-image: linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px); background-size: 20px 20px; }
.ph-thumb-sm { width: 168px; flex: none; border-radius: 16px; }
.ph-thumb-inner { position: absolute; inset: 0; display: block; transition: filter .2s var(--ph-ease), opacity .2s var(--ph-ease); }
.ph-thumb-svg { display: block; width: 100%; height: 100%; }
.ph-badges { position: absolute; left: 8px; top: 8px; display: flex; gap: 6px; }
.ph-badge { font-family: var(--ph-mono); text-transform: uppercase; letter-spacing: 0.1em; font-size: 9px; padding: 4px 8px; border-radius: 999px; background: rgba(10,10,11,0.75); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18); color: #fff; }
.ph-scenecount { position: absolute; left: 10px; bottom: 8px; font-family: var(--ph-mono); text-transform: uppercase; letter-spacing: 0.1em; font-size: 9px; color: var(--ph-sub); }
.ph-thumb-hint { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; font-weight: 500; opacity: 0; transition: opacity .2s var(--ph-ease); }
.ph-card-text { padding: 0 6px 6px; display: flex; flex-direction: column; gap: 5px; }
.ph-card-name { font-size: 15px; font-weight: 500; letter-spacing: -0.01em; }
.ph-card-by { font-size: 13px; color: var(--ph-soft); }
.ph-card-meta { font-size: 10px; color: var(--ph-sub); }
.ph-card-acts { position: absolute; top: 14px; right: 14px; display: flex; gap: 4px; }
.ph-card-acts .ph-icon-btn { width: 30px; height: 30px; background: rgba(10,10,11,0.75); opacity: 0; transition: opacity .16s var(--ph-ease), background-color .16s var(--ph-ease); }
.ph-card-acts .ph-icon-btn.on, .ph-card.menu-open .ph-card-acts .ph-icon-btn, .ph-card-acts .ph-icon-btn:focus-visible { opacity: 1; }
@media (hover: none) { .ph-card-acts .ph-icon-btn { opacity: 1; } }
.ph-card.locked .ph-thumb-inner { filter: grayscale(1); opacity: 0.3; }
.ph-card.locked .ph-card-text { opacity: 0.5; }
@media (hover: hover) and (pointer: fine) {
  .ph-card:hover { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.22), 0 22px 44px -24px rgba(0,0,0,0.9); }
  .ph-card:hover .ph-card-acts .ph-icon-btn, .ph-card:hover .ph-thumb-hint { opacity: 1; }
}
.ph-newtile { min-height: 240px; border: 1px dashed rgba(255,255,255,0.22); border-radius: 20px; background: transparent; color: var(--ph-sub); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; font-size: 14px; transition: border-color .16s var(--ph-ease), color .16s var(--ph-ease); }
@media (hover: hover) and (pointer: fine) { .ph-newtile:hover { border-color: rgba(255,255,255,0.45); color: #fff; } }
.ph-empty { margin: 0; padding: 40px 0; text-align: center; font-size: 14px; color: var(--ph-sub); }

/* ⋯ menu, the editor's popover */
.ph-menu { position: absolute; z-index: 5; top: 52px; right: 10px; width: 240px; padding: 6px; border-radius: 20px; display: flex; flex-direction: column; gap: 2px;
  background: var(--ph-glass-dense); box-shadow: var(--ph-shadow); -webkit-backdrop-filter: blur(28px); backdrop-filter: blur(28px); animation: ph-in .18s var(--ph-ease) both; }
.ph-menu-item { height: 40px; padding: 0 12px; border: 0; border-radius: 12px; background: transparent; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; text-align: left; }
.ph-menu-item.danger { color: #ff8a6a; }
@media (hover: hover) and (pointer: fine) { .ph-menu-item:hover { background: rgba(255,255,255,0.07); } }

/* trash */
.ph-trash { border-radius: 20px; overflow: hidden; }
.ph-trash-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.ph-trash-row:last-child { border-bottom: 0; }
.ph-trash-text { flex: 1 1 240px; display: flex; flex-direction: column; gap: 4px; }
.ph-trash-text .ph-mono { font-size: 10px; }
.ph-trash-name { font-size: 15px; font-weight: 500; }

/* scenes panel: the editor's inspector */
.ph-scrim { position: fixed; inset: 0; z-index: 8; background: rgba(5,5,6,0.35); }
.ph-drawer { position: fixed; z-index: 9; top: 88px; right: 16px; bottom: 16px; width: 360px; max-width: calc(100% - 32px); padding: 16px 18px 18px; border-radius: 24px; display: flex; flex-direction: column; gap: 14px; background: var(--ph-glass-dense); animation: ph-in .22s var(--ph-ease) both; }
.ph-drawer-head { display: flex; align-items: flex-start; gap: 8px; }
.ph-drawer-head > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ph-drawer-head h2 { margin: 0; font-size: 20px; line-height: 26px; font-weight: 600; letter-spacing: -0.02em; }
.ph-drawer-head .ph-mono:last-child { font-size: 10px; }
.ph-scenes { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -6px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.14) transparent; }
.ph-scene-row { display: flex; align-items: center; gap: 12px; padding: 8px; border: 0; border-radius: 14px; background: transparent; text-align: left; color: #fff; }
.ph-scene-row > svg { color: var(--ph-sub); flex: none; }
.ph-scene-num { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; font-size: 11px; letter-spacing: 0.04em; background: rgba(19,19,21,0.82); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.09); }
.ph-scene-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; font-size: 14px; font-weight: 500; }
.ph-scene-text .ph-mono { font-size: 10px; font-weight: 400; }
@media (hover: hover) and (pointer: fine) { .ph-scene-row:hover { background: rgba(255,255,255,0.06); } }
.ph-note { margin: 0; font-size: 10px; }
.ph-drawer-tools, .ph-drawer-acts { display: flex; gap: 8px; }
.ph-drawer-tools .ph-btn, .ph-drawer-acts .ph-btn { flex: 1; }

/* modal: the editor's sheet with the Kelvin line */
.ph-modal-wrap { position: fixed; inset: 0; z-index: 20; padding: 16px; display: grid; place-items: center; background: rgba(5,5,6,0.62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: ph-fade .2s var(--ph-ease) both; }
.ph-modal { position: relative; width: min(460px, 100%); padding: 26px; border-radius: 28px; overflow: hidden; display: flex; flex-direction: column; gap: 16px;
  background: var(--ph-glass-dense); box-shadow: var(--ph-shadow); -webkit-backdrop-filter: blur(28px); backdrop-filter: blur(28px); animation: ph-in .22s var(--ph-ease) both; }
.ph-kelvin { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: linear-gradient(90deg, #0A0A0B 0%, #5C1410 14%, #E2351C 30%, #FF5A1F 40%, #FF961F 50%, #FFD64A 60%, #FFF6DC 70%, #7FE6FF 80%, #2BB4FF 89%, #2A45D0 96%, rgba(16,22,80,0) 100%); }
.ph-modal-glow { position: absolute; left: -120px; top: -160px; width: 400px; height: 300px; pointer-events: none; background: radial-gradient(closest-side, rgba(255,90,31,0.18), transparent); }
.ph-modal > svg { position: relative; }
.ph-modal-x { position: absolute; top: 16px; right: 16px; }
.ph-modal-text { position: relative; display: flex; flex-direction: column; gap: 6px; }
.ph-modal h2 { margin: 0; font-size: 24px; line-height: 30px; font-weight: 500; letter-spacing: -0.02em; }
.ph-modal p { margin: 4px 0 0; font-size: 14px; line-height: 20px; color: var(--ph-sub); }
.ph-plans { position: relative; display: flex; flex-direction: column; gap: 8px; }
.ph-plan-opt { width: 100%; padding: 12px 16px; border: 0; border-radius: 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; text-align: left; background: rgba(19,19,21,0.82); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.09); transition: box-shadow .2s var(--ph-ease), background-color .2s var(--ph-ease); }
.ph-plan-opt > span:first-child { display: flex; flex-direction: column; gap: 3px; }
.ph-plan-opt b { font-size: 15px; font-weight: 600; }
.ph-plan-opt small { font-size: 12px; color: var(--ph-sub); }
.ph-plan-opt .ph-mono { font-size: 12px; letter-spacing: 0.04em; text-transform: none; white-space: nowrap; }
.ph-plan-opt.on { background: radial-gradient(90% 130% at 50% 100%, rgba(255,128,64,0.26), rgba(255,90,31,0.08) 45%, rgba(255,90,31,0) 80%), rgba(19,19,21,0.82); box-shadow: inset 0 0 0 1px rgba(255,90,31,0.55), 0 0 36px rgba(255,90,31,0.16); }
@media (hover: hover) and (pointer: fine) { .ph-plan-opt:not(.on):hover { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.22); } }
.ph-modal-acts { position: relative; display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.ph-modal-foot { position: relative; margin: 0 !important; text-align: center; font-size: 12px !important; color: var(--ph-sub); }
.ph-field input { width: 100%; height: 44px; padding: 0 14px; border: 0; border-radius: 14px; background: rgba(19,19,21,0.82); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.09); font-size: 15px; outline: 0; }
.ph-field input:focus { box-shadow: inset 0 0 0 1px #FF5A1F, 0 0 0 4px rgba(255,90,31,0.16); }

/* toast: the editor's white hint pill */
.ph-toast { position: fixed; z-index: 70; left: 50%; bottom: 20px; display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 16px; border-radius: 999px; background: #fff; color: #0A0A0B; font-family: var(--ph-sans); font-size: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5); transform: translate(-50%, 12px); opacity: 0; pointer-events: none; transition: opacity .2s var(--ph-ease), transform .2s var(--ph-ease); max-width: calc(100% - 32px); }
.ph-toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.ph-toast button { padding: 6px 12px; border: 0; border-radius: 999px; background: #F4F4F5; color: #0A0A0B; font: 500 12px var(--ph-sans); cursor: pointer; }

/* dev switch (demo only) */
.ph-dev { position: fixed; z-index: 7; left: 16px; bottom: 16px; display: flex; align-items: center; gap: 2px; padding: 4px; border-radius: 14px; background: var(--ph-glass-dense); box-shadow: var(--ph-shadow); font-size: 12px; }
.ph-dev > .ph-mono { padding: 0 8px; font-size: 10px; color: var(--ph-sub); }
.ph-dev button { height: 30px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: var(--ph-soft); font-size: 12px; }
.ph-dev button.on { background: #fff; color: #0A0A0B; }

@keyframes ph-in { from { opacity: 0; transform: translateY(6px) scale(0.99); } to { opacity: 1; transform: none; } }
@keyframes ph-fade { from { opacity: 0; } to { opacity: 1; } }

/* editor modal shown over the editor (scene limit, rename scene) */
body.ph-modal-only .ph-home { background: transparent; overflow: visible; }
body.ph-modal-only .ph-home > :not(.ph-modal-wrap) { display: none; }

/* ── Loader */
.ph-loader { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: #0A0A0B; color: #fff; font-family: var(--ph-sans); transition: opacity .22s var(--ph-ease); }
.ph-loader[hidden] { display: none; }
.ph-loader.out { opacity: 0; }
.ph-ld-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px); background-size: 80px 80px; background-position: center;
  -webkit-mask: radial-gradient(circle 340px at 50% 46%, #000, transparent); mask: radial-gradient(circle 340px at 50% 46%, #000, transparent); }
.ph-ld { position: relative; display: flex; flex-direction: column; align-items: center; gap: 28px; text-align: center; padding: 24px; }
.ph-ld-mark { position: relative; width: 136px; height: 136px; }
.ph-ld-mark svg { position: relative; overflow: visible; }
.ph-ld-glow { position: absolute; left: -34px; top: -34px; width: 128px; height: 128px; border-radius: 50%; opacity: 0; animation: ldGlow 1600ms cubic-bezier(0.77,0,0.175,1) 600ms infinite; }
.ph-ld-text { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ph-ld-name { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.ph-ld-scene { color: var(--ph-soft); }
.ph-ld-prog { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ph-ld-bar { width: 200px; height: 2px; border-radius: 2px; background: rgba(255,255,255,0.12); overflow: hidden; }
.ph-ld-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #5C1410, #E2351C, #FF5A1F, #FF961F, #FFD64A, #FFF6DC, #FFFFFF); }
.ph-ld-k { font-size: 10px; font-variant-numeric: tabular-nums; }
.ld-light { transform-box: fill-box; transform-origin: center; animation: ldLight 320ms var(--ph-ease) both; }
.ld-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: ldLine 480ms var(--ph-ease) 160ms forwards; }
.ld-ring { transform-box: fill-box; transform-origin: center; opacity: 0; animation: ldRing 420ms var(--ph-ease) 380ms forwards; }
.ld-cone { opacity: 0; animation: ldCone 1600ms cubic-bezier(0.77,0,0.175,1) 800ms infinite; }
.ld-fade { animation: ldFade 500ms var(--ph-ease) 300ms both; }
@keyframes ldLight { from { opacity: 0; transform: scale(0.3); } to { opacity: 1; transform: scale(1); } }
@keyframes ldLine { to { stroke-dashoffset: 0; } }
@keyframes ldRing { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
@keyframes ldCone { 0%, 100% { opacity: 0.06; } 50% { opacity: 0.38; } }
@keyframes ldGlow { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
@keyframes ldFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── Inside the editor: Home button, breadcrumb, scene menu, status */
.phos-nav:empty { display: none; }
.phos-nav { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 0 1 auto; margin-left: -12px; }
body.in-proj .topbar .brand, body.in-proj .topbar .tag, body.in-proj .topbar .title { display: none; }
body.in-proj .phos-nav { flex: 1 1 auto; }
.ph-home-wrap { position: relative; flex: none; }
.ph-home-btn { position: relative; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 999px; display: grid; place-items: center; background: transparent; cursor: pointer; transition: background-color .16s var(--ph-ease), transform .16s var(--ph-ease); }
.ph-home-btn svg { width: 24px; height: 24px; }
.ph-home-btn:active { transform: scale(0.97); }
.ph-dot { position: absolute; top: 9px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px #18181B; }
.ph-tip { position: absolute; left: 0; top: 52px; z-index: 30; white-space: nowrap; padding: 6px 10px; border-radius: 10px; background: #fff; color: #0A0A0B; font: 500 12px var(--ph-sans); opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity .15s var(--ph-ease), transform .15s var(--ph-ease); }
.ph-tip .ph-mono { font-size: 10px; color: #52525B; margin-left: 6px; letter-spacing: 0.06em; }
@media (hover: hover) and (pointer: fine) {
  .ph-home-btn:hover { background: rgba(255,255,255,0.08); }
  .ph-home-btn:hover + .ph-tip { opacity: 1; transform: none; transition-delay: .35s; }
}
.ph-home-btn:focus-visible + .ph-tip { opacity: 1; transform: none; }
.ph-crumb-sep { width: 1px; height: 22px; background: rgba(255,255,255,0.14); flex: none; }
.ph-crumbs { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 15px; }
.ph-crumb { border: 0; background: none; padding: 6px 4px; color: var(--ph-sub); font: 500 15px var(--ph-sans); cursor: pointer; border-radius: 8px; transition: color .16s var(--ph-ease); }
@media (hover: hover) and (pointer: fine) { .ph-crumb:hover { color: #fff; } }
.ph-slash { color: #52525B; }
.ph-crumb-cur { padding: 6px 4px; font-weight: 500; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ph-crumbs .ph-pill-sm { margin-left: 4px; }
.phos-status { font-family: var(--ph-mono); text-transform: uppercase; letter-spacing: 0.1em; font-size: 11px; color: var(--ph-sub); white-space: nowrap; }
.phos-status:empty { display: none; }

body.in-proj .notice { display: none; }

/* read-only projects: the plan can be looked at, not changed */
body.ph-ro .toolbar, body.ph-ro .inspector, body.ph-ro .sel-bar, body.ph-ro .pen-bar { display: none !important; }

/* ── Smaller screens */
@media (width <= 900px) {
  .ph-side { position: relative; top: 0; max-width: none; flex-basis: 100%; flex-direction: row; flex-wrap: wrap; gap: 12px; }
  .ph-side-group { flex: 1 1 200px; }
  .ph-plan { flex: 1 1 100%; }
}
@media (width <= 640px) {
  .ph-top { flex-wrap: wrap; border-radius: 28px; padding: 6px 6px 6px 14px; gap: 8px; width: calc(100% - 24px); }
  .ph-wordmark { font-size: 24px; }
  .ph-tag-l, .ph-tier { display: none; }
  .ph-top-r { margin-left: auto; gap: 6px; }
  .ph-top .ph-btn { padding: 0 16px; font-size: 14px; }
  .ph-search { order: 3; flex-basis: 100%; max-width: none; margin: 0 0 2px; }
  .ph-body { padding: 12px 12px 120px; }
  .ph-side { flex-direction: column; gap: 14px; padding: 10px 8px; }
  .ph-side-group:first-child { flex-direction: row; flex-wrap: wrap; }
  .ph-side-group:first-child .ph-nav { flex: 1 1 45%; }
  .ph-head h1 { font-size: 32px; line-height: 36px; }
  .ph-thumb-sm { width: 120px; }
  .ph-grid { grid-template-columns: 1fr; }
  .ph-usage { margin-left: 0; flex-basis: 100%; }
  .ph-drawer { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-width: none; max-height: 78dvh; }
  .ph-dev { left: 8px; right: 8px; bottom: 8px; overflow-x: auto; }
  .ph-dev > .ph-mono { display: none; }
  .phos-nav { margin-left: -8px; gap: 6px; }
  .ph-crumb, .ph-slash, .ph-crumb-sep { display: none; }
  .ph-crumb-cur { font-size: 14px; max-width: 34vw; }
  .phos-status { display: none; }
}
@media (max-height: 520px) and (orientation: landscape) {
}

@media (prefers-reduced-motion: reduce) {
}
@media (prefers-reduced-transparency: reduce) {
}
@media (width <= 640px) {
  .ph-side .ph-side-group { flex: none; }
  .ph-side-group:first-child, .ph-side-group:nth-child(2) { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
  .ph-side-group:nth-child(2) .ph-side-head { grid-column: 1 / -1; }
  .ph-side .ph-nav { height: 40px; }
  .ph-plan { padding: 12px; gap: 10px; }
}


/* ════ v0.20 · components from Diffused 02b (06 buttons, 07 header bar, 08 pills, tag search bar, 11 frames) ════ */
@property --gl { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --eg { syntax: "<number>"; inherits: true; initial-value: 0.55; }

/* 06 · Buttons, glass. The rim light rests at the top and follows the cursor; the
   main action turns Key only while hovered (plan button). No white buttons. */
.ph-btn, .topbar .actions .ghost, .topbar .actions .primary, [data-theme=dark] .topbar .actions .primary, .primary, .ghost {
  position: relative; isolation: isolate;
  --mx: 50%; --my: 0px; --gl: 0; --eg: 0.55;
  background: linear-gradient(180deg, rgba(255,255,255,.10) 0%, rgba(255,255,255,.03) 42%, rgba(255,255,255,.05) 100%), rgba(10,10,11,.62) !important;
  background-color: rgba(10,10,11,.62);
  -webkit-backdrop-filter: blur(28px) saturate(170%) contrast(1.06); backdrop-filter: blur(28px) saturate(170%) contrast(1.06);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.09), 0 22px 44px -24px rgba(0,0,0,.9) !important;
  color: #FFFFFF !important; border: 0 !important;
  transition: transform .16s var(--ph-ease), color .25s ease, --gl .32s var(--ph-ease), --eg .32s var(--ph-ease), background .25s ease;
}
.ph-btn::before, .topbar .actions .ghost::before, .topbar .actions .primary::before, .primary::before, .ghost::before {
  content: ""; position: absolute; z-index: -1; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(ellipse 90% 130% at var(--mx) 100%, rgba(255,128,64,.34), rgba(255,90,31,.12) 45%, rgba(255,90,31,0) 80%);
  opacity: var(--gl);
}
.ph-btn::after, .topbar .actions .ghost::after, .topbar .actions .primary::after, .primary::after, .ghost::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; padding: 1px;
  background: radial-gradient(120px circle at var(--mx) var(--my), rgba(255,242,228,.95), rgba(255,150,90,.55) 38%, rgba(255,255,255,0) 72%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: var(--eg);
}
.ph-btn.is-lit, .topbar .actions .is-lit, [data-theme=dark] .topbar .actions .is-lit, .primary.is-lit, .ghost.is-lit { --gl: 1; --eg: 1; }
.ph-btn { min-height: 44px; padding: 0 20px; font-size: 14px; }
.ph-btn-sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.ph-btn-primary:active, .topbar .actions .primary:active, .primary:active { background: #FF5A1F !important; color: #0A0A0B !important; }
@media (hover: hover) and (pointer: fine) {
  .ph-btn-primary:hover, .topbar .actions .primary:hover, [data-theme=dark] .topbar .actions .primary:hover, .primary:hover { background: #FF5A1F !important; color: #0A0A0B !important; box-shadow: inset 0 0 0 1px rgba(255,255,255,.09) !important; }
  .ph-btn-primary:hover::after, .primary:hover::after { opacity: 0; }
  .ph-btn-ghost:hover, .ph-icon-btn:hover { background: linear-gradient(180deg, rgba(255,255,255,.14) 0%, rgba(255,255,255,.05) 42%, rgba(255,255,255,.07) 100%), rgba(10,10,11,.62) !important; }
}
.ph-btn:focus-visible, .topbar .actions button:focus-visible, .primary:focus-visible, .ghost:focus-visible { outline: 2px solid #FF5A1F !important; outline-offset: 3px; }
.ph-quiet { color: #A1A1AA !important; }
/* editor bar actions: 44 px glass pills, sans */
.topbar .actions .ghost, .topbar .actions .ghost:not(.icon), .topbar .actions .primary, [data-theme=dark] .topbar .actions .primary {
  min-height: 44px; height: 44px; padding: 0 20px; border-radius: 999px; font: 500 15px var(--ph-sans); letter-spacing: 0; text-transform: none;
}
.ghost.icon { padding: 0; }

/* 07 · Header bar: the lit glass pill (diffused.css draws it); Home's bar is the same */
.ph-top { min-height: 60px; }
.ph-top-r { margin-left: auto; }
.ph-tier { padding: 0 6px; font-size: 11px; }
.ph-avatar { width: 44px; height: 44px; background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }

/* inside the editor bar: Home mark, Projects / project / scene ▾ */
.phos-nav { gap: 10px; }
.ph-crumbs { gap: 6px; }
.ph-scene-wrap { position: relative; flex: none; }
.ph-scene-btn { height: 36px; padding: 0 12px; border: 0; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px; color: #FFFFFF; font: 500 14px var(--ph-sans); white-space: nowrap; cursor: pointer;
  background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px rgba(255,255,255,.10); transition: background-color .16s var(--ph-ease), transform .16s var(--ph-ease); }
.ph-sb-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ph-scene-btn .ph-mono { font-size: 11px; letter-spacing: 0.04em; color: #A1A1AA; }
.ph-scene-btn svg { color: #A1A1AA; transition: transform .2s var(--ph-ease); }
.ph-scene-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.ph-scene-btn:active { transform: scale(0.97); }
.ph-scene-menu { position: absolute; left: 0; top: calc(100% + 14px); z-index: 30; width: 300px; padding: 6px; border-radius: 20px; display: flex; flex-direction: column; gap: 2px;
  background: linear-gradient(180deg, rgba(255,255,255,.08) 0%, rgba(255,255,255,.02) 42%, rgba(255,255,255,.04) 100%), rgba(14,14,16,.97); box-shadow: inset 0 0 0 1px rgba(255,255,255,.10), 0 24px 60px rgba(0,0,0,.6); animation: ph-in .16s var(--ph-ease) both; }
.ph-scene-item { height: 40px; flex: none; padding: 0 12px; border: 0; border-radius: 12px; display: flex; align-items: center; gap: 10px; background: transparent; color: #FFFFFF; font: 400 14px var(--ph-sans); text-align: left; cursor: pointer; transition: background-color .14s var(--ph-ease); }
.ph-scene-item.on { background: rgba(255,255,255,.08); }
.ph-si-num { width: 20px; flex: none; font-size: 11px; letter-spacing: 0.04em; color: #A1A1AA; }
.ph-si-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-si-meta { flex: none; font-size: 10px; letter-spacing: 0.08em; color: #8E8E93; }
.ph-si-sep { height: 1px; margin: 4px 8px; background: rgba(255,255,255,.08); flex: none; }
.ph-si-add { color: #A1A1AA; }
.ph-si-add .ph-si-num { font: 400 14px var(--ph-sans); text-align: center; }
.ph-scene-item:focus-visible, .ph-scene-btn:focus-visible { outline: 2px solid #FF5A1F; outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .ph-scene-btn:hover { background: rgba(255,255,255,.10); }
  .ph-scene-item:not(.on):hover { background: rgba(255,255,255,.06); }
  .ph-si-add:hover { color: #FFFFFF; }
}
.topbar { z-index: 20; }

/* 08 · Pills, tags & labels */
.ph-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; font-family: var(--ph-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  background: #1F1F22; color: #FFFFFF; box-shadow: inset 0 0 0 1px rgba(255,255,255,.10); }
.ph-chip i { width: 6px; height: 6px; border-radius: 50%; background: #FF5A1F; flex: none; }
.ph-chip.on { background: rgba(255,90,31,.16); color: #FFFFFF; box-shadow: inset 0 0 0 1px rgba(255,90,31,.55); }
@media (hover: hover) and (pointer: fine) { .ph-chip:not(.on):hover { box-shadow: inset 0 0 0 1px rgba(255,255,255,.24); } }
/* frame badges: Kelvin, counts and states over a frame */
.ph-badge, .ph-pill-sm { font-family: var(--ph-mono); text-transform: uppercase; letter-spacing: 0.1em; font-size: 10px; line-height: 14px; padding: 6px 10px; border-radius: 999px; color: #FFFFFF;
  background: rgba(10,10,11,.55); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); white-space: nowrap; }
.ph-pill-sm { padding: 4px 9px; font-size: 9px; color: #D4D4D8; }
/* segmented tabs: glass, the current one lifted */
.ph-seg { border-radius: 999px; padding: 4px; }
.ph-seg-btn { height: 40px; padding: 0 16px; border-radius: 999px; }
.ph-seg-btn.on { background: rgba(255,255,255,.10); color: #FFFFFF; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.ph-dev { border-radius: 999px; }
.ph-dev button { border-radius: 999px; }
.ph-dev button.on { background: rgba(255,255,255,.12); color: #FFFFFF; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }

/* Tag search bar · glass, chips inline */
.ph-tagbar { position: relative; isolation: isolate; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px; border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,.10) 0%, rgba(255,255,255,.03) 42%, rgba(255,255,255,.05) 100%);
  -webkit-backdrop-filter: blur(28px) saturate(170%) contrast(1.06); backdrop-filter: blur(28px) saturate(170%) contrast(1.06);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.09), 0 22px 44px -24px rgba(0,0,0,.9); transition: box-shadow .16s var(--ph-ease); }
.ph-tagbar:focus-within { box-shadow: inset 0 0 0 1px rgba(255,90,31,.55), 0 22px 44px -24px rgba(0,0,0,.9); }
.ph-tag-input { flex: 1 1 180px; min-width: 0; min-height: 40px; padding: 0 12px; display: flex; align-items: center; gap: 8px; color: #A1A1AA; }
.ph-tag-input input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-family: var(--ph-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: #FFFFFF; }
.ph-tag-input input::placeholder { color: #A1A1AA; }
.ph-tag-input input::-webkit-search-cancel-button { filter: invert(1); opacity: 0.5; }
.ph-tagcount { padding: 0 14px; font-size: 12px; color: #A1A1AA; white-space: nowrap; }

/* 11 · Frames: project cards are frames lit by their own key light */
.ph-grid { gap: 28px 20px; }
.ph-card { background: transparent !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; border-radius: 20px; }
.ph-card-main { padding: 0; gap: 12px; border-radius: 20px; }
.ph-frame { position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; border-radius: 20px; overflow: hidden; background: #131315; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); transition: box-shadow .2s var(--ph-ease); }
.ph-frame .ph-thumb-inner { position: absolute; inset: 0; }
.ph-frame .ph-thumb-inner::after { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 24px 24px; }
.ph-frame .ph-thumb-svg { position: relative; z-index: 1; }
.ph-badges { left: 14px; top: 14px; z-index: 2; }
.ph-frame-l, .ph-frame-r { position: absolute; z-index: 2; bottom: 14px; }
.ph-frame-l { left: 14px; }
.ph-frame-r { right: 14px; }
.ph-thumb-hint { z-index: 3; }
.ph-thumb-hint > span { padding: 10px 16px; border-radius: 999px; background: rgba(10,10,11,.72); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.ph-card-text { padding: 0 4px; gap: 6px; }
.ph-card-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.ph-card-name { font-size: 15px; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-card-by { flex: none; font-size: 11px; color: #8E8E93; }
.ph-card-meta { font-size: 11px; color: #8E8E93; }
.ph-card-acts { top: 12px; right: 12px; z-index: 4; }
.ph-card-acts .ph-icon-btn { width: 36px; height: 36px; border-radius: 999px; background: rgba(10,10,11,.62); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.ph-card.locked .ph-frame .ph-thumb-inner { filter: grayscale(1); opacity: 0.3; }
.ph-card.locked .ph-card-text { opacity: 0.5; }
@media (hover: hover) and (pointer: fine) {
  .ph-card:hover .ph-frame { box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); }
  .ph-card:hover { box-shadow: none !important; }
}
.ph-card-main:focus-visible { outline: 0; box-shadow: none !important; }
.ph-card-main:focus-visible .ph-frame { box-shadow: inset 0 0 0 2px #FF5A1F; }
.ph-newtile { min-height: 0; aspect-ratio: 16 / 10; align-self: start; border-radius: 20px; }
.ph-menu { top: 56px; right: 12px; }

/* panels near buttons: drawer actions, modal actions */
.ph-drawer-acts .ph-btn, .ph-drawer-tools .ph-btn { min-height: 44px; }
.ph-modal-acts .ph-btn { min-height: 44px; }

/* ── Loader: the mark fades in once, then the key light breathes while it loads */
.ph-ld-mark { width: 96px; height: 96px; animation: ldIn 420ms var(--ph-ease) both; }
.ph-ld-mark svg { display: block; width: 96px; height: 96px; }
.ph-ld-halo { position: absolute; left: -9px; top: -9px; width: 56px; height: 56px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255,128,64,.75), rgba(255,90,31,.25) 50%, rgba(255,90,31,0)); opacity: 0; animation: ldBreathe 1600ms cubic-bezier(0.77,0,0.175,1) 420ms infinite; }
@keyframes ldIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes ldBreathe { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.9; } }
.ph-ld-grid { -webkit-mask: radial-gradient(circle 300px at 50% 46%, #000, transparent); mask: radial-gradient(circle 300px at 50% 46%, #000, transparent); }
@media (prefers-reduced-motion: reduce) { .ph-ld-halo { animation: none; opacity: 0.6; } }

@media (width <= 640px) {
  .ph-scene-btn { max-width: 26vw; height: 36px; padding: 0 8px 0 10px; gap: 4px; }
  .ph-scene-btn .ph-mono { display: none; }
  .topbar .actions { gap: 6px; }
  .topbar .actions .ghost, .topbar .actions .ghost:not(.icon), .topbar .actions .primary, [data-theme=dark] .topbar .actions .primary { min-height: 40px; height: 40px; padding: 0 12px !important; font-size: 13px; }
  .ph-crumb-cur, .ph-slash-2 { display: none; }
  .ph-scene-menu { position: fixed; left: 16px; right: 16px; top: 76px; width: auto; }
  .ph-scene-item { height: 44px; }
  .ph-tagbar { border-radius: 24px; }
  .ph-tagcount { display: none; }
  .ph-chip { min-height: 36px; padding: 0 12px; font-size: 11px; }
  .ph-avatar { width: 40px; height: 40px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .ph-scene-menu { top: calc(100% + 8px); max-height: calc(100dvh - 72px); overflow-y: auto; }
  .topbar .actions .ghost, .topbar .actions .primary { min-height: 40px; height: 40px; }
}
@media (prefers-reduced-transparency: reduce) {
  .ph-btn, .ph-tagbar, .primary, .ghost { background: #1F1F22 !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}
@media (prefers-contrast: more) {
  .ph-btn, .ph-tagbar, .primary, .ghost { box-shadow: inset 0 0 0 1px rgba(255,255,255,.6) !important; }
}

/* frame placeholder until real frames exist */
.ph-frameholder::after { display: none; }
.ph-badges { align-items: center; }
.ph-fh-label { font-size: 10px; color: #FFFFFF; margin-right: 4px; }
.ph-badges { min-height: 26px; }
