/* v0.21 — the Phos app bar (appbar.css) fitted to Home and the editor.
   Loaded after home.css; only layout and overrides live here, the bar itself is in appbar.css. */

/* ── Home: full-width bar on top of the scrolling Home layer */
.ph-home .pab { position: sticky; top: 0; z-index: 30; }
.ph-home .pab-brand svg { width: 24px; height: 24px; }
.ph-home .pab-sheet { top: 56px; z-index: 29; }
.ph-side { top: 80px; }
.ph-body { padding-top: 24px; }
/* the sidebar now holds Folders and the plan; the sections live in the bar */
.ph-side .ph-side-group .ph-side-head { grid-column: 1 / -1; }
@media (width <= 900px) {
  .ph-side-group:first-child { flex-direction: column; }
}
@media (width <= 640px) {
  .ph-side-group:first-child { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
  .ph-body { padding-top: 12px; }
}

/* ── Editor: the React header becomes the same bar (home.js adds .pab to .topbar) */
.app { grid-template: "top" 64px "canvas" 1fr / 1fr; }
.topbar.pab {
  grid-area: top; position: relative; z-index: 20; display: flex; align-items: center; gap: 12px;
  width: 100%; max-width: none; height: 64px; min-height: 0; margin: 0; padding: 0 16px 0 20px; justify-self: stretch;
  border: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.06); border-radius: 0;
  background: radial-gradient(120px 22px at var(--lx) 100%, rgba(255, 90, 31, calc(0.16 * var(--lo))), rgba(255, 90, 31, 0) 100%) left bottom / 100% 22px no-repeat, rgba(10, 10, 11, 0.8) !important; box-shadow: none !important;
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important; isolation: isolate;
}
/* appbar.css draws the bottom-edge light with ::before / ::after; diffused.css's rim and glow are replaced by it */
.topbar.pab::after { content: ""; inset: auto 0 -1px 0; border-radius: 0; padding: 0; height: 1px; -webkit-mask: none; mask: none;
  background: radial-gradient(160px 1px at var(--lx) 50%, rgba(255, 140, 80, 0.95), rgba(255, 90, 31, 0.45) 45%, rgba(255, 90, 31, 0) 100%); opacity: var(--lo); }
/* the bar's blur on ::before so the scene menu inside it can blur the plan (same as appbar.css) */
.topbar.pab::before { content: ""; position: absolute; inset: 0; height: auto; border-radius: 0; z-index: -1; pointer-events: none; opacity: 1;
  background: none; -webkit-backdrop-filter: blur(40px) saturate(1.2); backdrop-filter: blur(40px) saturate(1.2); }

.topbar.pab .phos-nav { margin-left: 0; gap: 10px; }
/* the Home button is the app bar's brand button, same size and place as on Home (v0.24) */
.topbar.pab .ph-home-btn { width: auto; height: 40px; padding: 0 10px 0 6px; margin-left: -6px; border-radius: 999px; display: inline-flex; place-items: initial; align-items: center; justify-content: flex-start; gap: 8px; }
.topbar.pab .ph-home-wrap { display: inline-flex; align-items: center; }
.topbar.pab .ph-home-btn svg { width: 24px; height: 24px; }
.topbar.pab .ph-dot { top: 7px; right: auto; left: 21px; }
.topbar.pab .ph-tip { top: 50px; }
.topbar.pab .ph-crumb-sep { height: 18px; background: rgba(255, 255, 255, 0.1); margin: 0 2px; }
.topbar.pab .ph-crumbs { gap: 2px; font-size: 14px; }
.topbar.pab .ph-crumb { height: 34px; padding: 0 12px; border-radius: 999px; font-size: 14px; color: #A1A1AA; }
.topbar.pab .ph-crumb-cur { font-size: 14px; padding: 0 6px; }
.topbar.pab .ph-slash { color: #3F3F46; }
.topbar.pab .ph-scene-btn { height: 34px; padding: 0 12px 0 14px; border-radius: 999px; font-size: 14px; background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12); }
.topbar.pab .ph-scene-menu { top: calc(100% + 16px); border-radius: var(--pu-r-panel) !important; padding: 12px; }
.topbar.pab .ph-scene-item { border-radius: var(--pu-r-row); height: 40px; }
.topbar.pab .phos-status { font-size: 10.5px; color: #71717A; margin-left: auto; }

/* Gear list = a quiet link, Export PNG = the dark action that turns Key on hover */
.topbar.pab .actions { gap: 6px; margin-left: 8px; }
.topbar.pab .actions .ghost, .topbar.pab .actions .ghost:not(.icon) {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; min-height: 0; padding: 0 12px !important; border-radius: 999px !important;
  background: transparent !important; box-shadow: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; color: #A1A1AA; font: 500 14px var(--ph-sans); letter-spacing: 0; text-transform: none;
}
.topbar.pab .actions .primary, [data-theme=dark] .topbar.pab .actions .primary {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; min-height: 0; padding: 0 16px !important; border-radius: 999px !important;
  background: #1F1F22 !important; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; color: #fff !important; font: 500 14px var(--ph-sans);
}
/* icons drawn with a mask so the React buttons stay untouched */
.topbar.pab .actions .ghost::before, .topbar.pab .actions .primary::before {
  content: ""; position: static; inset: auto; width: 15px; height: 15px; flex: none; border-radius: 0; opacity: 1; background: currentColor; padding: 0;
  -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat;
}
.topbar.pab .actions .ghost::after, .topbar.pab .actions .primary::after { content: none; }
.topbar.pab .actions .ghost { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M9 6h11M9 12h11M9 18h11'/%3E%3Ccircle cx='4.5' cy='6' r='1' fill='black'/%3E%3Ccircle cx='4.5' cy='12' r='1' fill='black'/%3E%3Ccircle cx='4.5' cy='18' r='1' fill='black'/%3E%3C/svg%3E"); }
.topbar.pab .actions .primary { --ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11M7 10l5 5 5-5M5 20h14'/%3E%3C/svg%3E"); }
@media (hover: hover) and (pointer: fine) {
  .topbar.pab .ph-crumb:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
  .topbar.pab .actions .ghost:hover { color: #fff !important; background: rgba(255, 255, 255, 0.05) !important; }
  .topbar.pab .actions .primary:hover, [data-theme=dark] .topbar.pab .actions .primary:hover { background: #FF5A1F !important; color: #0A0A0B !important; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12) !important; }
}
.topbar.pab .actions .primary:active { transform: scale(0.97); background: #FF5A1F !important; color: #0A0A0B !important; }

/* the tool bar floats 12 px under the bar */
.toolbar { top: 76px; }

@media (max-width: 1023px) {
  .topbar.pab .ph-home-btn .pab-word { display: none; }
  .topbar.pab { padding: 0 12px 0 14px; }
}
@media (width <= 640px) {
  .app { grid-template: "top" 56px "canvas" 1fr / 1fr; }
  .topbar.pab { width: 100%; height: 56px; min-height: 0; padding: 0 8px 0 12px; gap: 6px; }
  .topbar.pab .phos-status { display: none; }
  .topbar.pab .actions .primary { height: 40px; padding: 0 12px !important; font-size: 13px; }
  .topbar.pab .ph-crumb-sep { display: none; }
  .toolbar { top: 68px; }
  .ph-scene-menu { top: 68px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .app { grid-template: "top" 52px "canvas" 1fr / 1fr; }
  .topbar.pab { height: 52px; margin-top: 0; }
  .toolbar { top: 60px; }
}
@media (prefers-reduced-transparency: reduce) { .topbar.pab { background: #0A0A0B; -webkit-backdrop-filter: none; backdrop-filter: none; } }
/* v0.24 · the account avatar at the right end of the editor bar, after Export */
.topbar.pab .ph-ed-avatar { margin-left: 8px; flex: none; }
@media (width <= 640px) { .topbar.pab .ph-ed-avatar { margin-left: 4px; } }
