/* Resources → Tools (assets/js/ems-alltools.js): the tools library, the first
   tab of Resources (a "Show every tool" pop-up until 11-09); the page scrolls,
   not a box. The cards are Pathways' experience cards (mpma-pathways
   origin/main assets/css/tool-cards.css .tx) on EMS tokens: each tool wears its journey's colour, shifted per tool (--a -> --b), with its
   REAL screens in a small window that flips through them (ems-tool-shots.js).
   Motion is CSS only and always ends visible; reduced motion turns it off. */

/* ── head: search, a chip per journey ─────────────────────────────── */
.ems-cat-head { display: flex; flex-direction: column; gap: 14px; padding: 0 0 20px; }
.ems-cat-find { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.ems-cat-q {
  flex: 1 1 340px; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-radius: 14px; max-width: 560px;
  background: var(--ems-soft); border: 1px solid var(--ems-line); color: var(--ems-mute);
  transition: border-color var(--ems-dur) var(--ems-ease), box-shadow var(--ems-dur) var(--ems-ease);
}
/* :not(#_) = id weight: ems-design.css styles every input through five :not()s. */
.ems-cat .ems-cat-q input:not(#_), .ems-cat .ems-cat-q input:not(#_):focus, .ems-cat .ems-cat-q input:not(#_):hover {
  flex: 1; width: auto; min-width: 0; margin: 0; border: 0; border-radius: 0; background: none; padding: 13px 0;
  font: 500 15.5px/1.3 var(--ems-font-ui); color: var(--ems-ink); outline: none; box-shadow: none; }
.ems-cat-q:focus-within { border-color: var(--ems-navy-500); background: #fff; box-shadow: var(--ems-focus); }
.ems-cat-sugg { display: flex; flex-wrap: wrap; gap: 6px; }
.ems-cat-sugg button {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--ems-line); background: #fff; cursor: pointer;
  font: 600 12.5px/1 var(--ems-font-ui); color: var(--ems-navy-600);
  transition: border-color var(--ems-dur) var(--ems-ease), background-color var(--ems-dur) var(--ems-ease);
}
.ems-cat-sugg button:hover { border-color: var(--ems-navy-300); background: var(--ems-navy-50); }
/* A nav: the sidebar's global `nav { flex-direction: column; flex: 1 }` must not reach it. */
.ems-cat-jumps { display: flex; flex-direction: row; flex-wrap: nowrap; flex: none; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.ems-cat-jumps::-webkit-scrollbar { display: none; }
.ems-cat-jump {
  flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 999px; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--c) 28%, var(--ems-line)); background: color-mix(in srgb, var(--c) 7%, #fff);
  font: 700 13px/1 var(--ems-font-ui); color: var(--c);
  transition: background-color var(--ems-dur) var(--ems-ease), color var(--ems-dur) var(--ems-ease), transform var(--ems-dur) var(--ems-ease);
}
.ems-cat-jump b { font-weight: 700; font-size: 11.5px; padding: 2px 7px; border-radius: 999px; background: color-mix(in srgb, var(--c) 14%, #fff); }
.ems-cat-jump:hover { background: var(--c); color: #fff; transform: translateY(-1px); }
.ems-cat-jump:hover b { background: rgba(255, 255, 255, .22); }
.ems-cat-jump:focus-visible, .ems-cat-sugg button:focus-visible { outline: none; box-shadow: var(--ems-focus); }

/* ── body: a section per journey ─────────────────────────────────────────── */
.ems-cat-body { padding: 0 0 34px; }
.ems-cat-g { margin: 0 0 30px; scroll-margin-top: 16px; }
.ems-cat-g[hidden] { display: none; }
.ems-cat-gh { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.ems-cat-gic { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 70%, #0e1547)); box-shadow: 0 8px 18px -10px var(--c); }
.ems-cat-gh h3 { margin: 0; font: 800 19px/1.2 var(--ems-font-display); color: var(--ems-navy-800); }
.ems-cat-gh p { margin: 2px 0 0; font: 400 13.5px/1.4 var(--ems-font-body); color: var(--ems-mute); }
.ems-cat-none { padding: 30px 6px; font: 400 15px/1.5 var(--ems-font-body); color: var(--ems-mute); }
.ems-cat-none b { color: var(--ems-navy-800); }

/* ── one tool, as an experience ─────────────────────────────────────────── */
@keyframes tx-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.ems-cat .tx-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 16px; }
.ems-cat .tx-grid > li { min-width: 0; animation: tx-in .45s calc(var(--d, 0) * 40ms) var(--ems-ease) backwards; }
.ems-cat .tx-grid > li[hidden] { display: none; }
.ems-cat .tx-card {
  display: flex; flex-direction: column; height: 100%; overflow: hidden; border-radius: 20px; background: #fff;
  border: 1px solid var(--ems-line); color: inherit; text-decoration: none; box-shadow: 0 1px 2px rgba(14, 21, 71, .04);
  transition: transform .3s var(--ems-ease-pop), box-shadow .3s var(--ems-ease), border-color .2s;
}
.ems-cat .tx-card:hover, .ems-cat .tx-card:focus-visible { transform: translateY(-4px); outline: none;
  border-color: color-mix(in srgb, var(--a) 35%, var(--ems-line)); box-shadow: 0 26px 44px -28px color-mix(in srgb, var(--b) 75%, transparent); }
.ems-cat .tx-card:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--a) 40%, transparent); }
.ems-cat .tx-art {
  position: relative; isolation: isolate; display: flex; align-items: flex-end; justify-content: space-between; height: 112px; padding: 14px 16px;
  background: radial-gradient(90% 120% at 0% 100%, rgba(255, 255, 255, .16) 0%, transparent 60%), linear-gradient(135deg, var(--a) 0%, var(--b) 100%);
  color: #fff; overflow: hidden;
}
/* A quiet grid on the art, so it reads as a surface, not a flat swatch. */
.ems-cat .tx-art::after { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .14;
  background-image: linear-gradient(rgba(255, 255, 255, .7) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .7) 1px, transparent 1px);
  background-size: 22px 22px; -webkit-mask-image: linear-gradient(90deg, transparent 20%, #000 100%); mask-image: linear-gradient(90deg, transparent 20%, #000 100%); }
.ems-cat .tx-glyph { position: relative; z-index: 3; width: 52px; height: 52px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .38); box-shadow: 0 10px 20px -12px rgba(0, 0, 0, .6);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); transition: transform .4s var(--ems-ease-pop); }
.ems-cat .tx-card:hover .tx-glyph { transform: translateY(-3px) rotate(-4deg) scale(1.05); }
/* "On your plan": gold, so the tools their answers picked stand out on any
   journey colour (Tyler 11-09: "should be more obvious gold"). */
.ems-cat .tx-kind { position: absolute; top: 12px; left: 14px; z-index: 3; display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px;
  font: 800 11px/1.2 var(--ems-font-ui); letter-spacing: .06em; text-transform: uppercase; color: #3d2a00;
  background: linear-gradient(135deg, #ffe08a 0%, #f5b82e 55%, #d99a0b 100%); border: 1px solid #fff1c2;
  box-shadow: 0 6px 14px -6px rgba(120, 80, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .6); }
.ems-cat .tx:has(.tx-kind) .tx-card { border-color: #f0c860; box-shadow: 0 0 0 1px #f5d27a, 0 1px 2px rgba(14, 21, 71, .04); }
.ems-cat .tx-body { display: flex; flex-direction: column; gap: 5px; padding: 15px 18px 16px; flex: 1; }
.ems-cat .tx-title { font: 800 17px/1.25 var(--ems-font-display); letter-spacing: -.005em; color: var(--ems-navy-800); }
.ems-cat .tx-name { font: 600 12.5px/1.3 var(--ems-font-ui); color: color-mix(in srgb, var(--b) 80%, var(--ems-mute)); }
.ems-cat .tx-pay { font: 400 14px/1.5 var(--ems-font-body); color: var(--ems-mute); }
.ems-cat .tx-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 12px; }
.ems-cat .tx-meta { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.ems-cat .tx-state { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 999px; font: 700 12px/1.2 var(--ems-font-ui);
  background: var(--ems-good-50); color: var(--ems-good); }
.ems-cat .tx-cta { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 12px; font: 800 14px/1 var(--ems-font-ui);
  color: #fff; background: linear-gradient(135deg, var(--a), var(--b)); box-shadow: 0 8px 16px -10px var(--b);
  transition: gap .25s var(--ems-ease-pop), box-shadow .25s; }
.ems-cat .tx-card:hover .tx-cta { gap: 10px; box-shadow: 0 12px 22px -10px var(--b); }

/* The tool's real screen, peeking up from the bottom right of its art. Frames
   cross-fade; the next one is never shown before it has loaded. */
.ems-cat .tx.has-shot .tx-art { height: 150px; }
.ems-cat .tx-shot {
  position: absolute; right: 14px; top: 40px; width: 64%; aspect-ratio: 1.6; z-index: 0; overflow: hidden;
  border-radius: 10px 10px 6px 6px; background: #f4f6f9; border: 1px solid rgba(255, 255, 255, .55);
  box-shadow: 0 18px 30px -14px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .18);
  transform: rotate(-1.2deg); transform-origin: 70% 100%; transition: transform .5s var(--ems-ease-pop), box-shadow .4s var(--ems-ease);
}
.ems-cat .tx-shot-bar { position: absolute; inset: 0 0 auto 0; height: 13px; display: flex; gap: 4px; align-items: center; padding: 0 7px;
  background: linear-gradient(180deg, #fff, #eef2f6); border-bottom: 1px solid #dfe5ec; z-index: 2; }
.ems-cat .tx-shot-bar > i { width: 5px; height: 5px; border-radius: 50%; background: #c7d0da; }
.ems-cat .tx-shot-bar > i:first-child { background: #f87171; }
.ems-cat .tx-shot-bar > i:nth-child(2) { background: #fbbf24; }
.ems-cat .tx-shot-bar > i:nth-child(3) { background: #34d399; }
.ems-cat .tx-shot-view { position: absolute; inset: 13px 0 0 0; overflow: hidden; }
.ems-cat .tx-frame { position: absolute; inset: 0; width: 100%; height: auto; display: block; opacity: 0; transform: scale(1.035);
  transition: opacity .9s var(--ems-ease), transform 3.6s var(--ems-ease); }
.ems-cat .tx-frame.is-on { opacity: 1; transform: scale(1); }
.ems-cat .tx-dots { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); display: none; gap: 4px; z-index: 2; padding: 3px 6px; border-radius: 99px; background: rgba(14, 21, 71, .45); }
.ems-cat .tx-dots > i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, .5); transition: background .3s, transform .3s; }
.ems-cat .tx-dots > i.is-on { background: #fff; transform: scale(1.25); }
.ems-cat .tx-card:hover .tx-shot, .ems-cat .tx-card:focus-visible .tx-shot { transform: translateY(-8px) rotate(0deg); box-shadow: 0 24px 36px -16px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .2); }
.ems-cat .tx-card:hover .tx-dots { display: flex; }
/* The glyph and chip read over the window: the left of the art is shaded. */
.ems-cat .tx.has-shot .tx-art::before { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, color-mix(in srgb, var(--b) 85%, #000) 0%, transparent 46%); opacity: .5; }

@media (max-width: 640px) {
  .ems-cat-sugg { display: none; }
  .ems-cat .tx-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .ems-cat .tx-grid > li, .ems-cat .tx-card, .ems-cat .tx-shot, .ems-cat .tx-glyph, .ems-cat .tx-frame, .ems-cat-jump { animation: none; transition: none; }
  .ems-cat .tx-card:hover, .ems-cat .tx-card:hover .tx-glyph, .ems-cat .tx-card:hover .tx-shot { transform: none; }
}

/* ── Recommended for you (ems-alltools.js paintRec) ─────────────────────────
   Three tools for where they are, at the very top; their own line (the
   brain's why) in place of the tool's general one. Steps aside while a search
   is typed. */
.ems-cat-rec { margin: 0 0 26px; padding: 20px 20px 22px; border-radius: 22px;
  background: linear-gradient(180deg, var(--ems-navy-50), #fff 70%); border: 1px solid var(--ems-line); }
.ems-cat-rec[hidden], .ems-cat-rec.is-off { display: none; }
.ems-cat-rech { margin: 0 0 14px; }
.ems-cat-rech h2 { margin: 0; font: 800 21px/1.2 var(--ems-font-display); color: var(--ems-navy-800); }
.ems-cat-recs { margin: 4px 0 0; font: 400 14px/1.45 var(--ems-font-body); color: var(--ems-mute); }
.ems-cat .tx-pay.is-why { color: var(--ems-navy-700); font-weight: 500; }
.ems-cat-rec .tx-grid { transition: opacity .25s var(--ems-ease); }
.ems-cat-rec.is-thinking .tx-grid { opacity: .78; }
@media (max-width: 760px) { .ems-cat-rec { padding: 16px 14px 18px; border-radius: 18px; } }
/* A recommended card's badge says where the pick came from ("Step 2 of your
   plan", "You started this"): white and sentence case, so it reads as a
   reason, not the gold "On your plan" medal. */
.ems-cat .tx-kind.is-rec { max-width: calc(100% - 28px); text-transform: none; letter-spacing: 0; font: 700 12px/1.25 var(--ems-font-ui);
  color: var(--ems-navy-800); background: #fff; border: 0; box-shadow: 0 6px 16px -8px rgba(14, 21, 71, .55); }
.ems-cat .tx-kind.is-rec svg { flex: none; color: var(--ems-navy-500); }
.ems-cat-rec .tx:has(.tx-kind.is-rec) .tx-card { border-color: var(--ems-line); box-shadow: 0 1px 2px rgba(14, 21, 71, .05); }

/* ── 11-16 every section a panel, like Recommended for you ─────────────────
   Tyler: "I like how, in All Tools, the Recommended for You actually has a
   background. That's what all of them should really have" - and Resources
   matches (ems-resources.css .rg-grp). Each journey is its own tinted panel
   in its colour, so the sections read apart instead of one long run of cards.
   The search box is Resources' box (.rg-find), so the two pages' tops match. */
.ems-cat-g { padding: 20px 20px 22px; border-radius: 22px; scroll-margin-top: 12px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 8%, #fff), #fff 72%);
  border: 1px solid color-mix(in srgb, var(--c) 16%, var(--ems-line)); }
.ems-cat-gh > div { flex: 1; min-width: 0; }
.ems-cat-gn { flex: none; padding: 4px 11px; border-radius: 999px; white-space: nowrap; font: 600 12.5px/1.3 var(--ems-font-ui);
  background: #fff; border: 1px solid color-mix(in srgb, var(--c) 20%, var(--ems-line)); color: var(--ems-mute); }
.ems-cat-gn.is-some { color: var(--c); }
.ems-cat-gn b { font-weight: 800; }
.ems-cat-q { min-height: 54px; border-radius: 16px; background: #fff; border: 1.5px solid var(--ems-line);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 28px -22px rgba(30, 41, 108, .45); }
.ems-cat-q > span { display: inline-flex; color: var(--ems-navy-500); }
/* what they have done with it */
.ems-cat .tx-used { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 999px; font: 600 12px/1.2 var(--ems-font-ui);
  background: var(--ems-navy-50); color: var(--ems-navy-700); }
.ems-cat .tx-used.is-new { background: none; padding-left: 0; color: var(--ems-faint, #8a94a6); font-weight: 600; }
@media (max-width: 760px) {
  .ems-cat-g { padding: 16px 14px 18px; border-radius: 18px; }
  .ems-cat-gn { display: none; }
}

/* ── Mentors and admins (ems-alltools.js staff/canSend) ─────────────────────
   One line on what trying a tool means for them; a mentor's Send sits on the
   art's top right, clear of the tool's screen below it. */
.ems-cat-staff { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 18px; padding: 12px 16px; border-radius: 14px;
  background: var(--ems-navy-50); border: 1px solid color-mix(in srgb, var(--ems-navy-500) 18%, var(--ems-line));
  font: 400 14.5px/1.5 var(--ems-font-body); color: var(--ems-navy-800); }
.ems-cat-staff > svg { flex: none; margin-top: 2px; color: var(--ems-navy-500); }
.ems-cat-staff b { font-weight: 700; }
.ems-cat .tx-grid > li { position: relative; }
.ems-cat .tx-send { position: absolute; top: 10px; right: 12px; z-index: 4; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  font: 750 12.5px/1 var(--ems-font-ui); color: #fff; background: rgba(14, 21, 71, .38); border: 1px solid rgba(255, 255, 255, .45);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: background-color var(--ems-dur) var(--ems-ease), color var(--ems-dur) var(--ems-ease); }
.ems-cat .tx-send:hover { background: #fff; color: var(--ems-navy-800); }
.ems-cat .tx-send:focus-visible { outline: none; box-shadow: var(--ems-focus); }
.ems-cat .tx-grid > li:has(.tx-send:hover) .tx-card { transform: translateY(-4px); }
