/* A tool's own page (/tools/<slug>/), laid out as a Marketplace item
   (blueprints.css `.ilayout`): the tool working where an item's preview
   stands, the item panel with the trial beside it, and under them the
   real app in pictures and where its work goes next. What a tool adds to
   the item page is here; on top of blueprints.css, tools/card.css and
   tools/tools.css. */

/* ---- the live viewport ----------------------------------------------------
   The app's viewer ground (#1e1e1e under a 30 px grid), with a few of the
   panel's controls drawn over it for the page. */
.mm-wrap { min-width: 0; }
.mm-stage {
  position: relative; aspect-ratio: 4 / 3.3; border-radius: 16px; overflow: hidden;
  background-color: #1e1e1e;
  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: 30px 30px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 30px 80px rgba(0, 0, 0, .5);
  color: #f2f4ee; font-size: 14px;
}
.mm-canvas { position: absolute; inset: 0; }
.mm-canvas canvas { display: block; touch-action: pan-y; cursor: grab; }
.mm-canvas canvas:active { cursor: grabbing; }
.mm-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .5s ease; }
.mm-stage.is-live .mm-poster { opacity: 0; pointer-events: none; }
/* The film: the tool's Motion project, rendered (/tools/player.js), until
   the reader asks for the live viewport. */
.mm-film { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; transition: opacity .4s ease; }
.mm-stage.is-live .mm-film { opacity: 0; pointer-events: none; }
.mm-try {
  position: absolute; right: 14px; bottom: 14px; z-index: 2; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .18); cursor: pointer;
  background: rgba(10, 11, 9, .78); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: #f2f4ee; font: 700 14px/1 var(--body);
}
.mm-try:hover { border-color: #7ee75d; }
.mm-try svg { width: 16px; height: 16px; }
.mm-stage.is-starting .mm-try { display: none; }
html:not(.js) .mm-try { display: none; }
/* A figure's video, in the phone. */
.tv-video { display: block; width: 100%; height: 100%; object-fit: cover; background: #000; }
.mm-fail { display: none; position: absolute; left: 16px; right: 16px; bottom: 16px; color: #c9cfc2; font-size: 14px; }
.mm-stage.is-failed .mm-fail { display: block; }
.mm-stage:not(.is-live) .mm-ui { visibility: hidden; }

.mm-ui { position: absolute; inset: 0; pointer-events: none; }
.mm-ui > * { pointer-events: auto; }
.mm-ask {
  position: absolute; left: 14px; right: 14px; top: 14px; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px 10px 14px; border-radius: 12px;
  background: rgba(10, 11, 9, .82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .1);
}
.mm-ask .mm-label { font: 800 10px/1.2 var(--display); letter-spacing: .1em; text-transform: uppercase; color: #a8afa1; white-space: nowrap; }
.mm-ask .mm-text { flex: 1; min-width: 0; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-ask .mm-text::after { content: ""; display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -2px; background: #7ee75d; opacity: 0; }
.mm-ask.is-typing .mm-text::after { opacity: 1; animation: mm-caret .8s steps(1) infinite; }
@keyframes mm-caret { 50% { opacity: 0; } }
.mm-paste {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 8px;
  font: 700 12px/1 var(--display); color: #0b1f07; background: #4cbf35; opacity: .35;
  transition: opacity .25s ease, transform .15s ease, box-shadow .25s ease;
}
.mm-paste svg { width: 14px; height: 14px; }
.mm-paste.is-on { opacity: 1; box-shadow: 0 0 0 4px rgba(76, 191, 53, .3); }
.mm-paste.is-press { transform: scale(.92); }
.mm-status {
  position: absolute; left: 50%; top: 74px; transform: translate(-50%, -6px); opacity: 0;
  padding: 7px 12px; border-radius: 999px; white-space: nowrap; font: 700 12.5px/1 var(--display);
  background: rgba(10, 11, 9, .82); border: 1px solid rgba(255, 255, 255, .12); color: #f2f4ee;
  transition: opacity .3s ease, transform .3s ease; pointer-events: none;
}
.mm-status.is-on { opacity: 1; transform: translate(-50%, 0); }
.mm-status.is-ai { border-color: #9b5cf6; }
.mm-status.is-ok { border-color: #4cbf35; }
.mm-status.is-edit { border-color: #54c43d; color: #7ee75d; }

.mm-models { position: absolute; right: 14px; top: 70px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.mm-models button, .mm-parts button {
  font: 700 12px/1 var(--display); padding: 7px 10px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, .16); background: rgba(10, 11, 9, .72); color: #c9cfc2;
}
.mm-models button[aria-pressed="true"], .mm-parts button[aria-pressed="true"] { background: #f2f4ee; color: #111310; border-color: #f2f4ee; }
.mm-models button:hover, .mm-parts button:hover { border-color: #7ee75d; }
.mm-edit {
  position: absolute; left: 14px; right: 14px; bottom: 14px; padding: 10px 12px; border-radius: 12px;
  background: rgba(10, 11, 9, .82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .1);
}
.mm-edit .mm-label { font: 800 10px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; color: #a8afa1; display: block; margin-bottom: 8px; }
.mm-parts { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 8px; min-height: 34px; }
.mm-parts::-webkit-scrollbar { display: none; }
.mm-swatches { display: flex; gap: 8px; }
.mm-swatches button {
  width: 24px; height: 24px; border-radius: 50%; cursor: pointer; padding: 0;
  background: var(--c); border: 2px solid rgba(255, 255, 255, .18);
}
.mm-swatches button[aria-pressed="true"] { border-color: #fff; box-shadow: 0 0 0 2px #54c43d; }
.mm-ui button:focus-visible { outline: 2px solid #7ee75d; outline-offset: 2px; }
.mm-note { margin-top: 12px; font-size: 13px; color: var(--muted); }

/* ---- the app in pictures ----------------------------------------------- */
.tp-shot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 48px; align-items: center; margin-top: 40px; }
.tp-shot.is-flip { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); }
.tp-shot.is-flip > .tp-words { order: 2; }
.tp-words { position: sticky; top: 150px; }
.tp-words .step { font: 800 12px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); }
.tp-words h3 { font: 800 24px/1.15 var(--display); letter-spacing: -0.01em; margin-top: 10px; }
.tp-words p { color: var(--muted); margin-top: 12px; font-size: 16.5px; }
.tp-shot .hp-fig { margin: 0; }

/* The help site's picture player (help.css, "the picture player"), carried
   here on this site's colours: the help pages and these pages run one
   script, /help/help.js, whose Player acts only on .hp-fig. */
.hp-fig { --hi: #ffb020; --hi-glow: rgba(255, 176, 32, .28); max-width: min(100%, calc(var(--w) + 2px)); }
.hp-win, .hp-phone { border-radius: 12px; overflow: hidden; background: #0b0b0b; border: 1px solid var(--line); box-shadow: 0 18px 50px rgba(0, 0, 0, .22); }
/* The app's screens here are a phone's: a dark bezel round the frame. */
.hp-phone { max-width: 340px; margin: 0 auto; border-radius: 42px; border: 9px solid #1d1d1f; }
.tp-shot .hp-fig { max-width: 340px; margin: 0 auto; }
/* A tablet's or a computer's screen (tool/tool_page.mjs): the whole width
   it is given, in a slimmer bezel. */
.hp-fig.is-wide, .tp-shot .hp-fig.is-wide { max-width: 100%; }
.hp-tab { border-radius: 22px; overflow: hidden; background: #0b0b0b; border: 10px solid #1d1d1f; box-shadow: 0 0 0 1px var(--line), 0 24px 60px rgba(0, 0, 0, .28); }
.tp-hero .hp-fig { margin: 0; }
.tp-hero .hp-fig:not(.is-wide) { max-width: 340px; margin: 0 auto; }
.tp-shot.is-wide { grid-template-columns: minmax(0, 1fr); gap: 22px; }
.tp-shot.is-wide > .tp-words { position: static; max-width: 640px; }
/* A grid item with auto margins shrinks to its content; a screen this wide
   takes the column. */
.tp-shot.is-wide .hp-fig, .tp-hero .hp-fig.is-wide { width: 100%; }
.hp-bar { position: relative; height: 30px; display: flex; align-items: center; gap: 7px; padding: 0 12px; background: #1d1d1f; border-bottom: 1px solid #000; }
.hp-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.hp-bar i:nth-child(2) { background: #febc2e; }
.hp-bar i:nth-child(3) { background: #28c840; }
.hp-bar span { position: absolute; left: 0; right: 0; text-align: center; font-size: 12px; color: #9a9a9a; pointer-events: none; }
.hp-stage { position: relative; overflow: hidden; background: #000; }
.hp-frame img { display: block; width: 100%; height: 100%; }
html.js .hp-frame { position: absolute; inset: 0; opacity: 0; transition: opacity .45s ease; }
html.js .hp-frame.is-on { opacity: 1; }
html.js .hp-mark { display: none; }
html:not(.js) .hp-stage { aspect-ratio: auto !important; }
html:not(.js) .hp-frame { position: relative; }
html:not(.js) .hp-frame + .hp-frame { border-top: 6px solid var(--paper); }
html:not(.js) .hp-box, html:not(.js) .hp-ring, html:not(.js) .hp-cursor, html:not(.js) .hp-play { display: none; }
.hp-mark, .hp-box {
  position: absolute; border: 2.5px solid var(--hi); border-radius: 9px;
  box-shadow: 0 0 0 5px var(--hi-glow), 0 0 22px rgba(255, 176, 32, .35);
  margin: -5px 0 0 -5px; padding: 5px; box-sizing: content-box; pointer-events: none;
}
.hp-mark b { position: absolute; left: -12px; top: -12px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--hi); color: #1a1200; }
.hp-box { opacity: 0; transition: opacity .3s, left .7s cubic-bezier(.4, 0, .2, 1), top .7s cubic-bezier(.4, 0, .2, 1), width .7s cubic-bezier(.4, 0, .2, 1), height .7s cubic-bezier(.4, 0, .2, 1); }
.hp-box.is-on { opacity: 1; }
.hp-box.is-point { animation: hp-glow 1.4s ease-in-out infinite alternate; }
@keyframes hp-glow { from { box-shadow: 0 0 0 4px var(--hi-glow); } to { box-shadow: 0 0 0 9px var(--hi-glow), 0 0 26px rgba(255, 176, 32, .5); } }
.hp-ring { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: rgba(255, 255, 255, .55); border: 2px solid var(--hi); opacity: 0; pointer-events: none; }
.hp-ring.is-press { animation: hp-tap .65s ease-out; }
@keyframes hp-tap { 0% { opacity: .9; transform: scale(.25); } 100% { opacity: 0; transform: scale(1.8); } }
.hp-cursor {
  position: absolute; left: 88%; top: 92%; width: 22px; height: 26px; margin: -2px 0 0 -2px;
  transform-origin: 2px 2px; pointer-events: none; opacity: 0;
  fill: #111310; stroke: #fff; stroke-width: 1.4; stroke-linejoin: round; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .55));
  transition: left .9s cubic-bezier(.4, 0, .2, 1), top .9s cubic-bezier(.4, 0, .2, 1), opacity .3s, transform .15s;
}
.hp-cursor.is-on { opacity: 1; }
.hp-cursor.is-press { transform: scale(.82); }
.hp-fig figcaption { position: relative; margin-top: 12px; padding-right: 48px; }
.hp-beats { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.hp-beats button {
  display: flex; align-items: baseline; gap: 10px; width: 100%; text-align: left; font: inherit; font-size: 15px;
  color: var(--muted); background: none; border: 0; padding: 6px 10px; border-radius: 8px; cursor: pointer; line-height: 1.45;
}
.hp-beats button:hover { background: var(--paper-soft); color: var(--ink); }
.hp-beats b { flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; background: var(--paper-soft); color: var(--muted); border: 1px solid var(--line); transform: translateY(-1px); }
.hp-beats li.is-on button { color: var(--ink); background: var(--paper-soft); box-shadow: inset 0 0 0 1px var(--line); }
.hp-beats li.is-on b { background: var(--hi); border-color: var(--hi); color: #1a1200; }
.hp-beats strong { color: var(--ink); }
.hp-play { position: absolute; right: 0; top: 2px; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; border: 1px solid var(--line); background: var(--paper); color: var(--ink); display: grid; place-items: center; }
.hp-play[hidden] { display: none; }
.hp-play:hover { border-color: var(--accent); color: var(--accent-text); }
.hp-play svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.hp-play .i-play { display: none; fill: currentColor; stroke: none; }
.hp-fig.is-paused .hp-play .i-play { display: block; }
.hp-fig.is-paused .hp-play .i-pause { display: none; }
html.js .hp-stage { cursor: zoom-in; }
.hp-zoom { position: fixed; inset: 0; z-index: 60; overflow: auto; background: rgba(0, 0, 0, .92); display: flex; align-items: flex-start; justify-content: flex-start; cursor: zoom-out; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.hp-zoom img { display: block; flex: none; margin: auto; max-width: none; }
.hp-zoom button { position: fixed; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .16); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }

/* ---- where it goes next ---- */
.tp-next { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 26px 0 0; list-style: none; padding: 0; }
.tp-next > li { display: flex; }
.tp-next > li > .tcard { flex: 1; }
.tp-next > li.tp-binder { display: block; padding: 24px 22px; border: 1px dashed var(--rule); border-radius: 12px; align-self: start; }
.tp-next .tp-binder h3 { font: 800 16.5px/1.25 var(--display); }
.tp-next .tp-binder p { color: var(--muted); font-size: 14.5px; margin-top: 8px; }

@media (max-width: 760px) {
  .tp-shot, .tp-shot.is-flip { grid-template-columns: 1fr; gap: 22px; }
  .tp-shot.is-flip > .tp-words { order: 0; }
  .tp-words { position: static; }
}
@media (max-width: 720px) {
  .tp-next { grid-template-columns: 1fr; }
  .mm-stage { aspect-ratio: 3 / 4; }
  .mm-models { flex-direction: row; left: 14px; right: 14px; top: 68px; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .mm-ask .mm-label { display: none; }
  .mm-status { top: 112px; }
}
@media (prefers-reduced-motion: reduce) {
  .hp-frame, .hp-box, .hp-cursor { transition: none !important; }
  .hp-box.is-point { animation: none; }
  .hp-cursor, .hp-ring { display: none; }
  .mm-ask.is-typing .mm-text::after { animation: none; }
  .mm-status, .mm-poster { transition: none; }
}
