/* /_shell.css — applied by the worker to every TOOL page (not hub, chat,
   admin). Now minimal:
     - Light dotted grid backdrop (lighter than the IR vs 2B native one).
     - Container width sync: any top-level .container / main / .wrap /
       .page / .app on a tool page is constrained to the same max width as
       the hub so the tools feel visually aligned.

   The floating back-pill and signature footer were removed - each tool keeps
   its own header and footer. */

/* Smooth cross-document navigation between same-origin pages.
   Browsers that support View Transitions API (Chrome/Edge 126+, Safari 18.2+)
   crossfade between pages automatically. Older browsers ignore the rule and
   navigate normally — no breakage, no JS needed. */
@view-transition {
  navigation: auto;
}

/* === FORWARD nav (hub -> tool): card MORPH ===
   The clicked card is given view-transition-name=__morph by JS.
   The destination page's <body> gets the same name (via .__via_morph on <html>).
   Browser then animates the card's rect -> body's full-viewport rect,
   visually growing the card into the new page. */
.card.__opening{view-transition-name:__morph}
html.__via_morph body{view-transition-name:__morph}

::view-transition-old(__morph){animation:__morph_out 360ms ease-out both}
::view-transition-new(__morph){animation:__morph_in 650ms cubic-bezier(0.22,0.61,0.36,1) both}
@keyframes __morph_out{to{opacity:0}}
@keyframes __morph_in{from{opacity:0}to{opacity:1}}

/* When morphing, kill the circular reveal so the morph is the only story. */
html.__via_morph::view-transition-new(root){animation:none;opacity:1}
html.__via_morph::view-transition-old(root){animation:__pop_recede 500ms ease-out both}

/* === BACK nav (tool -> hub) / fallback: circular reveal from click point. */
::view-transition-old(root){
  animation:__pop_recede 360ms cubic-bezier(0.4,0,0.2,1) both;
  transform-origin:var(--pop-x,50%) var(--pop-y,50%);
  z-index:1;
}
::view-transition-new(root){
  animation:__pop_reveal 580ms cubic-bezier(0.22,0.61,0.36,1) both;
  z-index:2;
}
@keyframes __pop_recede{
  from{opacity:1;transform:scale(1)}
  to{opacity:0.45;transform:scale(0.94)}
}
@keyframes __pop_reveal{
  from{clip-path:circle(0 at var(--pop-x,50%) var(--pop-y,50%))}
  to  {clip-path:circle(220vmax at var(--pop-x,50%) var(--pop-y,50%))}
}
@media (prefers-reduced-motion:reduce){
  ::view-transition-old(root),::view-transition-new(root),
  ::view-transition-old(__morph),::view-transition-new(__morph){animation:none}
}

body.tool-shell {
  position: relative;
}

body.tool-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(15, 28, 58, .012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 28, 58, .012) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 95% 75% at 50% 0%, #000 25%, transparent 82%);
  mask-image: radial-gradient(ellipse 95% 75% at 50% 0%, #000 25%, transparent 82%);
}

/* Uniform container max-width across tools. Matches the hub (1280px).
   Uses !important so per-tool stylesheets that set a smaller max-width get
   overridden - this is intentional for visual consistency. */
body.tool-shell > .container,
body.tool-shell > main,
body.tool-shell > .wrap,
body.tool-shell > .page,
body.tool-shell > .app,
body.tool-shell > .layout {
  max-width: 1280px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Brand-mark visual refresh when the shell replaces its contents */
body.tool-shell .brand-mark svg,
body.tool-shell .logo-mark svg { width: 22px; height: 22px; color: #fff; }

/* Sticky compact footer on every tool page */
body.tool-shell { padding-bottom: 36px; }
.ts-sticky {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid #e8ecf4;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 11px;
  color: #8a97ad;
  line-height: 1;
}
.ts-sticky b { color: #475569; font-weight: 600; }
.ts-sticky .ts-watermark { color: #a8b2c4; font-size: 10.5px; font-weight: 500; margin-left: 4px; }
.ts-sticky .ts-right { display: inline-flex; align-items: center; gap: 6px; }
.ts-sticky .ts-pulse {
  width: 5px; height: 5px; border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, .18);
  animation: tsPulseSmall 2.6s ease-in-out infinite;
}
@keyframes tsPulseSmall { 0%, 100% { opacity: 1 } 50% { opacity: .45 } }
@media (max-width: 480px) {
  .ts-sticky { padding: 0 12px; font-size: 10.5px; }
  .ts-sticky .ts-right span:not(.ts-pulse) { display: none; }
}
