/* Team pages only (html.motion, set by js/motion.js outside artist/client/creator cabinets), and for now only for the owner
   (.app.m-on from MainLayout; html.m-on from motion.js for windows outside .app) - owner, 2026-11-06. */

/* Table headers stay on screen while the page scrolls, like Google Sheets (js/motion.js moves them; the table keeps
   scrolling with the page and sideways on its own). */
.app.m-on .tbl thead th { position: relative; z-index: 3; background: var(--surface); }
.app.m-on .tbl thead.stuck th { box-shadow: inset 0 -1px 0 var(--border-2), 0 6px 10px -8px rgba(0, 0, 0, .6); }

@media (prefers-reduced-motion: no-preference) {
  /* A new page comes in all at once, softly, only after its data is there (js/navhold.js) - no blocks one by one. */
  .motion .app.m-on .main.nav-in > .page { animation: m-fade .18s ease both; }
  /* Windows and side panels. */
  .motion.m-on .overlay { animation: m-fade .2s ease both; }
  .motion.m-on .modal { animation: m-pop .24s cubic-bezier(.2, .75, .2, 1) both; }
  .motion.m-on .drawer { animation: m-slide .3s cubic-bezier(.2, .75, .2, 1) both; }
  /* Switching a view: the new one comes from the side the button is on; the old one leaves the other way (motion.js). */
  .motion.m-on .swap-panel { animation: m-in-right .32s cubic-bezier(.2, .75, .2, 1) both; }
  .motion.m-on .swap-host.from-left .swap-panel { animation-name: m-in-left; }
  .motion.m-on .swap-ghost { position: absolute; left: 0; right: 0; top: 0; pointer-events: none; animation: m-out-left .26s ease both; z-index: 1; }
  .motion.m-on .swap-host.from-left .swap-ghost { animation-name: m-out-right; }
  .motion.m-on .seg button { transition: background .18s, color .18s, box-shadow .18s; }
  .motion.m-on .tbl tbody tr { transition: background .12s; }
}
.swap-host { position: relative; }

@keyframes m-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes m-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes m-pop { from { opacity: 0; transform: translateX(-50%) translateY(8px) scale(.98); } to { opacity: 1; transform: translateX(-50%); } }
@keyframes m-slide { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes m-in-right { from { opacity: 0; transform: translateX(48px); } to { opacity: 1; transform: none; } }
@keyframes m-in-left { from { opacity: 0; transform: translateX(-48px); } to { opacity: 1; transform: none; } }
@keyframes m-out-left { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(-48px); } }
@keyframes m-out-right { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(48px); } }

/* The previous page's picture while the next one loads (js/navhold.js), and the thin bar on top of it. */
#nav-hold .nav-pic { position: fixed; z-index: 40; pointer-events: none; overflow: hidden; background: var(--bg); }
#nav-hold .nav-bar { position: fixed; z-index: 41; left: 0; right: 0; top: 0; height: 2px; background: var(--accent);
  transform-origin: left; animation: nav-bar 6s cubic-bezier(.1, .7, .2, 1) both; }
@keyframes nav-bar { from { transform: scaleX(0); } to { transform: scaleX(.92); } }
@media (prefers-reduced-motion: reduce) { #nav-hold .nav-bar { animation: none; transform: scaleX(.5); } }

/* Guide (js/guide.js): the switch at the bottom right, the ring around the lit element and its note. */
#guide-root .guide-toggle { position: fixed; right: 18px; bottom: 18px; z-index: 60; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border-2); background: var(--panel); color: var(--text); font: inherit; font-size: 13px; cursor: pointer;
  box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .7); }
#guide-root .guide-toggle.on { border-color: var(--accent); color: var(--accent); }
#guide-root .guide-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#guide-root .guide-ring { position: fixed; z-index: 58; pointer-events: none; border-radius: 12px; border: 2px solid var(--accent);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .45); transition: left .2s, top .2s, width .2s, height .2s; }
#guide-root .guide-tip { position: fixed; z-index: 59; width: min(340px, calc(100vw - 24px)); padding: 14px 16px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--border-2); color: var(--text); box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .8); }
#guide-root .guide-tip p { margin: 0 0 12px; font-size: 13.5px; line-height: 1.5; white-space: pre-line; }
#guide-root .guide-row { display: flex; align-items: center; gap: 8px; }
#guide-root .guide-n { color: var(--muted); font-size: 12px; margin-right: auto; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { #guide-root .guide-ring { transition: none; } }

/* Codex review 11: the Guide button never covers a dialog's or a drawer's buttons. */
body:has(.modal) #guide-root .guide-toggle, body:has(.drawer) #guide-root .guide-toggle { display: none; }
