/* Integrations hub, template redesign v2.
   Chrome colours: base.html tokens only (--surface, --surface-2, --ink, --ink-2,
   --text-tertiary, --muted, --neutral, --accent, --secondary, --olive,
   --secondary-ink, --inverse-ink, --dark) and white.
   App brand colours appear ONLY tied to their app, passed in as --b (the
   app's hex from logos/manifest.json): tinted logo tiles, a category chip
   dot, the workflow node ring. Marks are never recoloured. */

/* ── Logo tile ───────────────────────────────────────────────────────── */
.lg { --b: #1c1a14; position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
      background: color-mix(in srgb, var(--b) 11%, #fff); border-radius: 10px; overflow: hidden; }
.lg img, .lg .lgi { width: 62%; height: 62%; object-fit: contain; display: block; }
.lg.is-bleed img, .lg.is-bleed .lgi { width: 100%; height: 100%; }
.lg.is-bleed { background: transparent; }
.lg.is-white { background: #fff; box-shadow: inset 0 0 0 1px var(--surface-2); }
.lg.is-white img, .lg.is-white .lgi { width: 78%; height: 78%; }
.lg.is-dark { background: var(--ink); }
/* black marks (GitHub, Notion, PostHog, Resend, Kit, Vercel, X): white tile + hairline, full contrast (QA v2 minor 7) */
.lg.is-ink { background: #fff; box-shadow: inset 0 0 0 1px var(--neutral); }
.lg.is-ink img, .lg.is-ink .lgi { width: 64%; height: 64%; }
.lg-xs { width: 20px; height: 20px; border-radius: 6px; }
.lg-sm { width: 28px; height: 28px; border-radius: 8px; }
.lg-md { width: 44px; height: 44px; border-radius: 11px; }
.lg-lg { width: 64px; height: 64px; border-radius: 16px; }
.lg-xl { width: 88px; height: 88px; border-radius: 22px; }
.lg-stack { display: inline-flex; }
.lg-stack > .lg { box-shadow: 0 0 0 2px #fff; }
.lg-stack > .lg + .lg { margin-left: -6px; }
.lg-stack > .lg.is-white { box-shadow: 0 0 0 2px #fff, inset 0 0 0 1px var(--surface-2); }

/* ── Category chip with an app-coloured dot ───────────────────────────── */
.v2-chip { display: inline-flex; align-items: center; gap: .45rem; border-radius: 99px; border: 1px solid var(--neutral); background: #fff;
           padding: .4rem .9rem .4rem .5rem; font-size: 14px; color: var(--ink-2); cursor: pointer; transition: border-color .15s, background-color .15s; }
.v2-chip .lg { box-shadow: none; }
.v2-chip .n { color: var(--muted); font-size: 12px; }
.v2-chip:hover { border-color: var(--ink); color: var(--ink); }
.v2-chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--inverse-ink); }
.v2-chip.is-on .n { color: var(--inverse-ink); opacity: .65; }
.v2-chip.all { padding-left: .9rem; }

/* ── Hero orbit (app page): app logo in the centre, connected logos around ── */
.v2-orbit { position: relative; width: 100%; max-width: 440px; aspect-ratio: 1; margin: 0 auto; }
.v2-orbit .orb { position: absolute; inset: 0; border-radius: 50%; border: 1px dashed var(--neutral); }
.v2-orbit .orb.r2 { inset: 17%; }
.v2-orbit .spin { position: absolute; inset: 0; animation: v2spin 90s linear infinite; }
.v2-orbit .spin.r2 { inset: 17%; animation-duration: 60s; animation-direction: reverse; }
/* --r = ring radius; the orbit is square, so a % of its width works for both rings */
.v2-orbit { container-type: inline-size; }
.v2-orbit .spin { --r: -50cqw; }
.v2-orbit .spin.r2 { --r: -33cqw; }
.v2-orbit .sat { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(var(--a)) translateY(var(--r)) rotate(calc(-1 * var(--a))); }
.v2-orbit .sat > .lg { animation: v2spin 90s linear infinite reverse; box-shadow: 0 6px 18px rgba(28,26,20,.10); }
.v2-orbit .spin.r2 .sat > .lg { animation-duration: 60s; animation-direction: normal; }
.v2-orbit .core { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 14px; border-radius: 30px; background: #fff;
                  box-shadow: 0 20px 50px rgba(28,26,20,.14); }
.v2-orbit .core::after { content: ""; position: absolute; inset: -10px; border-radius: 36px; border: 2px solid color-mix(in srgb, var(--b) 40%, transparent); animation: v2pulse 3.2s ease-out infinite; }
@keyframes v2spin { to { transform: rotate(360deg); } }
.v2-orbit .sat > .lg { will-change: transform; }
@keyframes v2pulse { 0% { opacity: .9; transform: scale(.92); } 100% { opacity: 0; transform: scale(1.18); } }

/* ── Mini workflow strip (hero preview + job cards) ───────────────────── */
.v2-flow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.v2-flow .st { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px; background: var(--surface); border: 1px solid var(--surface-2); color: var(--ink-2); }
.v2-flow .st svg { width: 15px; height: 15px; }
.v2-flow .st.ok { background: var(--secondary); border-color: var(--secondary); color: var(--ink); }
.v2-flow .ar { width: 12px; height: 1px; background: var(--neutral); }

/* ── Job card v2 ──────────────────────────────────────────────────────── */
.v2-job { position: relative; display: flex; flex-direction: column; gap: 14px; background: #fff; border: 1px solid var(--neutral); border-radius: 16px; padding: 20px; transition: border-color .15s, box-shadow .15s; }
.v2-job:hover { border-color: var(--ink); box-shadow: 0 18px 40px rgba(28,26,20,.07); }
.v2-job h3, .v2-job h4 { font-size: 17px; line-height: 1.3; font-weight: 750; letter-spacing: -.01em; color: var(--ink); }
.v2-job .sum { font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.v2-job .foot { margin-top: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.v2-run { display: inline-flex; align-items: center; gap: .5rem; border-radius: 99px; background: var(--ink); color: var(--secondary); font-size: 14px; font-weight: 600;
          padding: .5rem .95rem .5rem .6rem; border: 0; cursor: pointer; transition: background-color .15s; }
.v2-run:hover { background: var(--ink-3); }
.v2-run .pl { width: 22px; height: 22px; border-radius: 50%; background: var(--secondary); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.v2-run .pl svg { width: 10px; height: 10px; margin-left: 2px; }
.v2-more { font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--neutral); }
.v2-more:hover { text-decoration-color: var(--ink); }
.v2-job details summary { list-style: none; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-tertiary); display: inline-flex; align-items: center; gap: .35rem; }
.v2-job details summary::-webkit-details-marker { display: none; }
.v2-job details[open] summary .chev { transform: rotate(90deg); }
.v2-job details .chev { transition: transform .15s; }

/* ── Capability chart (compact comparison) ────────────────────────────── */
.v2-chart { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid var(--neutral); border-radius: 16px; overflow: hidden; font-size: 14px; }
.v2-chart th, .v2-chart td { padding: .75rem .7rem; text-align: center; border-top: 1px solid var(--surface-2); }
.v2-chart thead th { border-top: 0; font-size: 12.5px; font-weight: 650; color: var(--text-tertiary); vertical-align: bottom; line-height: 1.3; }
.v2-chart tbody th { text-align: left; font-weight: 700; color: var(--ink); padding-left: 1rem; }
.v2-chart tr.hl th, .v2-chart tr.hl td { background: var(--secondary); }
.v2-chart tr.hl th { color: var(--ink); }
.v2-m { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; }
.v2-m svg { width: 13px; height: 13px; }
.v2-m.yes { background: var(--ink); color: var(--secondary); }
.v2-m.partly { background: var(--surface-2); color: var(--ink-2); }
.v2-m.no { color: var(--neutral); }
.v2-chart-wrap { max-width: 100%; overflow-x: auto; }
/* Under 768px each option becomes a card: name on top, the capability marks as labelled rows */
@media (max-width: 767px) {
  .v2-chart, .v2-chart tbody, .v2-chart tr, .v2-chart th, .v2-chart td { display: block; }
  .v2-chart { background: transparent; border: 0; border-radius: 0; overflow: visible; }
  .v2-chart thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .v2-chart tbody tr { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px 2px; background: #fff; border: 1px solid var(--neutral); border-radius: 14px; padding: 10px 10px 12px; margin-bottom: 8px; }
  .v2-chart tbody th { grid-column: 1 / -1; border: 0; padding: 2px 4px 6px; font-size: 15px; }
  .v2-chart td { border: 0; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10.5px; line-height: 1.2; color: var(--text-tertiary); text-align: center; }
  .v2-chart td::after { content: attr(data-label); }
  .v2-chart tr.hl { background: var(--secondary); border-color: var(--olive); }
  .v2-chart tr.hl th, .v2-chart tr.hl td { background: transparent; }
}

/* ── Action groups as collapsible rows ────────────────────────────────── */
.v2-acts { background: #fff; border: 1px solid var(--neutral); border-radius: 16px; overflow: hidden; }
.v2-acts details + details { border-top: 1px solid var(--surface-2); }
.v2-acts summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 14px 18px; }
.v2-acts summary::-webkit-details-marker { display: none; }
.v2-acts summary:hover { background: var(--surface); }
.v2-acts .nm { font-size: 15px; font-weight: 700; color: var(--ink); }
.v2-acts .ds { font-size: 13px; color: var(--text-tertiary); margin-top: 1px; }
.v2-acts .bar { flex-shrink: 0; display: flex; gap: 3px; }
.v2-acts .bar i { width: 6px; height: 16px; border-radius: 2px; background: var(--surface-2); display: block; }
.v2-acts .bar i.on { background: var(--ink); }
.v2-acts .bar i.w { background: var(--olive); }
.v2-acts .chev { color: var(--muted); transition: transform .15s; flex-shrink: 0; }
.v2-acts details[open] .chev { transform: rotate(90deg); }
.v2-acts ul { padding: 0 18px 14px 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.v2-acts li { font-size: 12.5px; color: var(--ink-2); background: var(--surface); border-radius: 99px; padding: .2rem .65rem; }

/* ── Logo grid of connected apps ──────────────────────────────────────── */
.v2-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 10px; }
.v2-cell { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px 12px; border-radius: 14px; background: #fff;
           border: 1px solid var(--surface-2); text-align: center; font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.25; }
.v2-cell.is-link { border-color: var(--neutral); }
.v2-cell.is-link:hover { border-color: var(--ink); }
.v2-cell .sub { font-size: 11px; font-weight: 500; color: var(--muted); }
.v2-cell .pin { position: absolute; top: 7px; right: 7px; font-size: 10px; font-weight: 700; background: var(--secondary); color: var(--ink); border-radius: 99px; padding: 1px 6px; }
@media (max-width: 480px) { .v2-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; } .v2-cell { padding: 12px 4px 10px; font-size: 12px; } }

/* ── Start modes as three illustrated tiles ───────────────────────────── */
.v2-mode { background: #fff; border: 1px solid var(--neutral); border-radius: 16px; padding: 20px; }
.v2-mode .ic { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--ink); }
.v2-mode .ic svg { width: 20px; height: 20px; }
.v2-mode.on .ic { background: var(--ink); color: var(--secondary); }
.v2-mode.off { background: transparent; border-style: dashed; }
.v2-mode.off .ic { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--neutral); }
.v2-tag { display: inline-flex; align-items: center; gap: .3rem; font-size: 11.5px; font-weight: 700; border-radius: 99px; padding: .1rem .55rem; }
.v2-tag.y { background: var(--secondary); color: var(--ink); }
.v2-tag.n { background: var(--surface-2); color: var(--text-tertiary); }

/* ── Dark band (the one "see it" section) ─────────────────────────────── */
.v2-dark { background: var(--dark); color: var(--inverse-ink); }
.v2-dark .ih-lede, .v2-dark p { color: rgba(244,245,246,.72); }
.v2-dark h2, .v2-dark h3 { color: var(--inverse-ink); }

/* ── Big stat row ─────────────────────────────────────────────────────── */
.v2-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.v2-stat { display: inline-flex; align-items: baseline; gap: .45rem; background: #fff; border: 1px solid var(--surface-2); border-radius: 12px; padding: .55rem .85rem; font-size: 13px; color: var(--text-tertiary); }
.v2-stat b { font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }

/* ── Featured guide cards on the directory ────────────────────────────── */
.v2-feat { position: relative; display: flex; flex-direction: column; gap: 14px; border-radius: 16px; padding: 22px; background: #fff; border: 1px solid var(--neutral); transition: border-color .15s, box-shadow .15s; overflow: hidden; }
.v2-feat:hover { border-color: var(--ink); box-shadow: 0 18px 40px rgba(28,26,20,.08); }
.v2-feat .wash { position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: color-mix(in srgb, var(--b) 12%, transparent); }
.v2-feat .kind { font-size: 12px; font-weight: 700; color: var(--secondary-ink); }

/* ── Directory app card v2 ────────────────────────────────────────────── */
.v2-app { --b: #1c1a14; position: relative; display: flex; gap: 12px; align-items: flex-start; border-radius: 14px; padding: 14px; background: #fff; border: 1px solid var(--surface-2); }
.v2-app.is-link { border-color: var(--neutral); box-shadow: inset 0 3px 0 0 color-mix(in srgb, var(--b) 70%, #fff); }
.v2-app.is-link:hover { border-color: var(--ink); }
.v2-app h3 { font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.v2-app p { font-size: 13px; line-height: 1.45; color: var(--ink-2); margin-top: 2px; }
.v2-app .meta { font-size: 11.5px; color: var(--muted); margin-top: 6px; display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.v2-app .meta .ev { color: var(--ink-2); font-weight: 600; }

/* ── Logo wall (directory hero) ───────────────────────────────────────── */
.v2-wall { display: grid; grid-template-columns: repeat(8, 1fr); gap: 10px; }
.v2-wall .lg { width: 100%; height: auto; aspect-ratio: 1; border-radius: 14px; }
.v2-wall .lg img, .v2-wall .lg .lgi { width: 56%; height: 56%; }
.v2-wall .lg.is-bleed img, .v2-wall .lg.is-bleed .lgi { width: 100%; height: 100%; }
.v2-wall .lg.is-white img, .v2-wall .lg.is-white .lgi { width: 72%; height: 72%; }
.v2-wall > * { animation: v2pop .5s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 18ms); }
@keyframes v2pop { from { opacity: 0; transform: translateY(8px) scale(.94); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) { .v2-wall { grid-template-columns: repeat(6, 1fr); gap: 6px; } .v2-wall .lg { border-radius: 10px; } }

/* ── Section rhythm helpers ───────────────────────────────────────────── */
.v2-sec { padding: 64px 0; }
@media (max-width: 640px) { .v2-sec { padding: 44px 0; } }
.v2-kicker { display: inline-flex; align-items: center; gap: .5rem; font-size: 14px; font-weight: 600; color: var(--secondary-ink); }

@media (prefers-reduced-motion: reduce) {
  .v2-orbit .spin, .v2-orbit .sat > .lg, .v2-orbit .core::after, .v2-wall > * { animation: none !important; }
}

/* ======================================================================
   SIMULATION MODAL ("See it run")
   ====================================================================== */
.sim-root { position: fixed; inset: 0; z-index: 60; }
.sim-root[hidden] { display: none; }
.sim-ov { position: absolute; inset: 0; background: rgba(14,14,14,.62); }
.sim-wrap { position: relative; height: 100%; width: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; overflow-y: auto; }
.sim-box { position: relative; width: 100%; max-width: 980px; background: var(--surface); border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.35);
           display: flex; flex-direction: column; max-height: calc(100vh - 48px); overflow: hidden; }
.sim-head { display: flex; align-items: flex-start; gap: 14px; padding: 18px 20px 14px; border-bottom: 1px solid var(--surface-2); }
.sim-head h2 { font-size: 18px; font-weight: 800; letter-spacing: -.015em; color: var(--ink); line-height: 1.25; }
.sim-label { display: inline-flex; align-items: center; gap: .4rem; font-size: 11.5px; font-weight: 700; color: var(--ink); background: var(--secondary); border-radius: 99px; padding: .15rem .6rem; }
.sim-x { margin-left: auto; flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--text-tertiary); background: transparent; border: 0; cursor: pointer; }
.sim-x:hover { background: var(--surface-2); color: var(--ink); }
.sim-tabs { display: flex; gap: 6px; padding: 12px 20px 0; }
.sim-tab { position: relative; flex: 1; display: flex; align-items: center; gap: 8px; border: 0; background: transparent; cursor: pointer; text-align: left; padding: 8px 4px 12px; font-size: 14px; font-weight: 600; color: var(--muted); }
.sim-tab .nb { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; background: var(--surface-2); color: var(--text-tertiary); flex-shrink: 0; }
.sim-tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 3px; background: var(--surface-2); }
.sim-tab .fill { position: absolute; left: 0; bottom: 0; height: 3px; border-radius: 3px; background: var(--ink); width: 0; z-index: 1; }
.sim-tab.is-on { color: var(--ink); }
.sim-tab.is-on .nb, .sim-tab.is-done .nb { background: var(--ink); color: var(--secondary); }
.sim-tab.is-done .fill { width: 100%; }
.sim-body { flex: 1; overflow-y: auto; padding: 18px 20px 20px; height: 600px; max-height: calc(100vh - 230px); }
.sim-pane[hidden] { display: none; }
.sim-foot { display: flex; align-items: center; gap: 12px; padding: 14px 20px; background: var(--ink); }
.sim-foot p { font-size: 13.5px; color: rgba(244,245,246,.75); line-height: 1.4; }
.sim-foot p b { color: var(--inverse-ink); font-weight: 700; }
.sim-replay { display: inline-flex; align-items: center; gap: .4rem; border-radius: 99px; border: 1px solid rgba(244,245,246,.3); color: var(--inverse-ink); background: transparent; padding: .5rem .9rem; font-size: 14px; font-weight: 500; cursor: pointer; flex-shrink: 0; }
.sim-replay:hover { border-color: var(--inverse-ink); }
.sim-foot .ih-pill-cta { flex-shrink: 0; margin-left: auto; padding: .6rem 1.2rem; font-size: 14px; }
body.sim-lock { overflow: hidden; }

/* (a) Letaido chat, drawn from the product's UI language */
.sim-app { background: #fdfdfd; border: 1px solid #e3e2de; border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; height: 100%; min-height: 400px; }
.sim-app-top { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px; border-bottom: 1px solid #ecebe8; font-size: 13.5px; color: #1c1a14; }
.sim-app-top img { height: 18px; width: 18px; }
.sim-app-top .t { color: #55534d; }
.sim-feed { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 16px; font-size: 14.5px; line-height: 1.6; color: #1c1a14; }
.sim-user { align-self: flex-end; background: #ededed; border-radius: 14px; padding: 9px 13px; max-width: 86%; }
.sim-step { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #55534d; }
.sim-step svg { width: 12px; height: 12px; }
.sim-text ol { margin: 6px 0 0; padding-left: 0; counter-reset: s; list-style: none; }
.sim-text ol li { counter-increment: s; position: relative; padding-left: 26px; margin-top: 4px; }
.sim-text ol li::before { content: counter(s); position: absolute; left: 0; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #ecebe8; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; color: #3d3b36; }
.sim-card { background: #fdfdfd; border: 1px solid #dcdcdc; border-radius: 16px; padding: 13px 15px; font-size: 13.5px; }
.sim-card .hd { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; }
/* long tool ids (ahrefs_site_explorer.organic_keywords) must wrap inside the card, not run past it */
.sim-card .hd .tl { min-width: 0; overflow-wrap: break-word; line-height: 1.4; }
/* approval card: everything under the title starts at the text column (20px logo + 9px gap) */
.sim-card.is-ap .desc, .sim-card.is-ap .btns { padding-left: 29px; }
.sim-card .hd svg { flex-shrink: 0; margin-top: 3px; color: #3d3b36; }
.sim-card .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; padding-left: 26px; }
.sim-card .cols div div:first-child { color: #55534d; }
.sim-card .btns { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; padding-left: 26px; flex-wrap: wrap; }
.sim-card .desc { font-size: 12.5px; color: #55534d; line-height: 1.45; margin-top: 6px; padding-left: 26px; }
.sim-b { display: inline-flex; align-items: center; border-radius: 7px; padding: 4px 11px; font-size: 13.5px; }
.sim-b.ghost { border: 1px solid #c9c9c9; background: #fdfdfd; color: #1c1a14; }
.sim-b.dark { background: #303030; color: #fdfdfd; }
.sim-b.ok { background: #d6ecda; color: #2f9a4c; gap: 6px; }
.sim-b.press { transform: scale(.95); }
.sim-pill { border: 1px solid #d4d4d4; border-radius: 999px; padding: 1px 8px; font-size: 11.5px; color: #3d3b36; white-space: nowrap; }
.sim-mark { width: 14px; height: 14px; flex-shrink: 0; margin-top: 4px; }
.sim-comp { margin: 0 14px 12px; border: 1px solid #e0e0e0; border-radius: 14px; padding: 11px 13px 9px; background: #fdfdfd; }
.sim-comp .in { min-height: 22px; font-size: 14.5px; color: #8a8780; }
.sim-comp .in.typing { color: #1c1a14; }
.sim-comp .row { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; color: #55534d; font-size: 13px; }
.sim-comp .snd { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #ecebe8; color: #55534d; transition: background-color .15s; }
.sim-comp .snd.on { background: #1c1a14; color: #fdfdfd; }
.sim-caret { display: inline-block; width: 1.5px; height: 1em; background: #1c1a14; vertical-align: -2px; margin-left: 1px; animation: simblink 1s steps(1) infinite; }
@keyframes simblink { 50% { opacity: 0; } }
.sim-think { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: #55534d; }
.sim-think i { width: 16px; height: 16px; border-radius: 50%; background: #9a9540; display: inline-block; animation: simpulse 1s ease-in-out infinite; }
@keyframes simpulse { 50% { transform: scale(.75); opacity: .6; } }
.sim-in { animation: simin .35s cubic-bezier(.2,.8,.2,1) both; }
@keyframes simin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* (b) Visual workflow */
.sim-flow-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 18px; align-items: start; }
.sim-flow { position: relative; display: flex; flex-direction: column; gap: 0; padding: 4px 0; }
.sim-node { --b: #1c1a14; position: relative; display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--surface-2); border-radius: 14px; padding: 10px 12px; opacity: .45; transition: opacity .3s, border-color .3s, box-shadow .3s, transform .3s; }
.sim-node + .sim-node { margin-top: 22px; }
.sim-node + .sim-node::before { content: ""; position: absolute; left: 30px; top: -23px; width: 2px; height: 22px; background: var(--surface-2); transition: background-color .3s; }
.sim-node.is-on { opacity: 1; border-color: var(--ink); box-shadow: 0 10px 26px rgba(28,26,20,.10); transform: translateX(2px); }
.sim-node.is-done { opacity: 1; border-color: var(--neutral); }
.sim-node.is-done::before, .sim-node.is-on::before { background: var(--ink); }
.sim-node .nic { width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); color: var(--ink); }
/* app-logo icons match the 38px plain icons so every node's text lines up */
.sim-node .nic-lg { width: 38px; height: 38px; border-radius: 10px; }
.sim-node .nic svg { width: 18px; height: 18px; }
.sim-node .nic.ai { background: var(--ink); color: var(--secondary); }
.sim-node .nic.ap { background: var(--secondary); color: var(--ink); }
.sim-node .nl { font-size: 14px; font-weight: 700; color: var(--ink); line-height: 1.25; }
.sim-node .nd { font-size: 12.5px; color: var(--text-tertiary); margin-top: 1px; }
.sim-node .kd { margin-left: auto; flex-shrink: 0; font-size: 11px; font-weight: 700; border-radius: 99px; padding: .1rem .5rem; background: var(--surface); color: var(--ink-2); border: 1px solid var(--surface-2); }
.sim-node .kd.w { background: var(--secondary); border-color: var(--secondary); color: var(--ink); }
.sim-node .kd.st { background: var(--ink); border-color: var(--ink); color: var(--secondary); }
.sim-node .tick { position: absolute; right: -7px; top: -7px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); color: var(--secondary); display: none; align-items: center; justify-content: center; }
.sim-node .tick svg { width: 10px; height: 10px; }
.sim-node.is-done .tick { display: inline-flex; }
.sim-side { position: sticky; top: 0; display: flex; flex-direction: column; gap: 10px; }
.sim-side .lbl { font-size: 12px; font-weight: 700; color: var(--text-tertiary); }
.sim-log { background: #fff; border: 1px solid var(--surface-2); border-radius: 12px; padding: 10px 12px; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; min-height: 64px; }
.sim-log div + div { margin-top: 3px; }

/* (c) Result views */
.sim-res-grid { display: grid; gap: 14px; }
.sim-res-grid.two { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
.sim-cap { font-size: 13px; color: var(--text-tertiary); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
/* sheet */
.sx { background: #fff; border: 1px solid #dadce0; border-radius: 10px; overflow: hidden; font-family: Arial, 'Inter', sans-serif; }
.sx-top { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid #e3e3e3; font-size: 13px; color: #202124; }
.sx-top .lg { box-shadow: none; }
.sx-fx { display: flex; align-items: center; gap: 8px; padding: 4px 10px; border-bottom: 1px solid #e3e3e3; font-size: 12px; color: #5f6368; }
.sx-fx i { font-style: italic; font-family: Georgia, serif; }
.sx-scroll { overflow-x: auto; }
.sx table { border-collapse: collapse; width: 100%; font-size: 12px; color: #202124; }
.sx th, .sx td { border: 1px solid #e2e3e3; padding: 5px 7px; text-align: left; white-space: nowrap; }
.sx thead th { background: #f8f9fa; color: #5f6368; font-weight: 400; text-align: center; font-size: 11px; padding: 3px 7px; }
.sx tbody th { background: #f8f9fa; color: #5f6368; font-weight: 400; text-align: center; width: 30px; font-size: 11px; }
.sx tr.hdr td { font-weight: 700; }
.sx tr.new td { animation: sxin .45s ease-out both; }
.sx tr.new td { background: color-mix(in srgb, var(--b, #34a853) 9%, #fff); }
.sx td.chg { box-shadow: inset 0 0 0 2px var(--b, #34a853); }
.sx tr.pending { visibility: hidden; }
.sx tr.note td { color: #3c4043; font-style: italic; white-space: normal; }
.sx-tabs { display: flex; gap: 2px; padding: 4px 8px; background: #f8f9fa; border-top: 1px solid #e3e3e3; font-size: 12px; color: #5f6368; overflow-x: auto; }
.sx-tabs span { padding: 3px 10px; border-radius: 6px 6px 0 0; white-space: nowrap; }
.sx-tabs span.on { background: #fff; color: color-mix(in srgb, var(--b, #34a853) 80%, #000); font-weight: 700; box-shadow: inset 0 -2px 0 var(--b, #34a853); }
@keyframes sxin { from { opacity: 0; } to { opacity: 1; } }
/* CRM record */
.rx { --b: #ff7a59; background: #fff; border: 1px solid #dfe3eb; border-radius: 10px; overflow: hidden; font-size: 13px; color: #33475b; }
.rx-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid #eaf0f6; }
.rx-av { width: 40px; height: 40px; border-radius: 50%; background: color-mix(in srgb, var(--b) 16%, #fff); color: color-mix(in srgb, var(--b) 75%, #000); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.rx-nm { font-weight: 700; font-size: 15px; color: #2d3e50; }
.rx-sub { font-size: 12px; color: #516f90; }
.rx-ob { margin-left: auto; font-size: 11px; color: #516f90; display: inline-flex; align-items: center; gap: 6px; }
.rx-props { padding: 6px 14px 10px; }
.rx-p { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid #f0f3f7; }
.rx-p span:first-child { color: #516f90; }
.rx-p span:last-child { font-weight: 600; color: #2d3e50; text-align: right; }
.rx-p.chg span:last-child { background: color-mix(in srgb, var(--b) 15%, #fff); border-radius: 5px; padding: 0 6px; }
.rx-act { margin: 4px 14px 14px; border: 1px solid #eaf0f6; border-radius: 8px; padding: 10px 12px; background: #f5f8fa; }
.rx-act b { display: block; font-size: 12px; color: #2d3e50; margin-bottom: 3px; }
.rx-act p { font-size: 12.5px; line-height: 1.5; color: #33475b; }
/* Slack-style message */
.mx { background: #fff; border: 1px solid #e3e3e3; border-radius: 10px; overflow: hidden; font-size: 13.5px; color: #1d1c1d; }
.mx-top { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid #ebebeb; font-weight: 700; }
.mx-msg { display: flex; gap: 10px; padding: 12px; }
.mx-av { width: 34px; height: 34px; border-radius: 8px; background: var(--ink); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mx-av img { width: 20px; height: 20px; }
.mx-nm { font-weight: 800; }
.mx-nm small { font-weight: 400; color: #616061; font-size: 11.5px; margin-left: 6px; }
.mx-nm .app { font-size: 10px; font-weight: 700; color: #616061; background: #ebebeb; border-radius: 3px; padding: 0 4px; margin-left: 4px; }
.mx-ln { line-height: 1.5; margin-top: 2px; }
.mx-ln:first-of-type { font-weight: 700; }

@media (max-width: 767px) {
  .sim-wrap { padding: 0; align-items: stretch; }
  .sim-box { max-height: 100vh; height: 100%; border-radius: 0; }
  .sim-head { padding: 14px 14px 10px; }
  .sim-head h2 { font-size: 16px; }
  .sim-tabs { padding: 8px 14px 0; gap: 4px; }
  .sim-tab { font-size: 12.5px; gap: 6px; padding-bottom: 10px; }
  .sim-tab { white-space: nowrap; }
  .sim-body { padding: 14px; min-height: 0; }
  .sim-flow-wrap { grid-template-columns: 1fr; }
  .sim-side { position: static; }
  .sim-res-grid.two { grid-template-columns: 1fr; }
  .sim-foot { flex-wrap: wrap; padding: 12px 14px; }
  .sim-foot p { flex: 1; font-size: 12px; }
  .sim-foot { flex-wrap: nowrap; gap: 8px; }
  .sim-replay { padding: .45rem .7rem; font-size: 13px; }
  .sim-foot .ih-pill-cta { padding: .55rem .9rem; font-size: 13px; }
  .sim-foot .ih-pill-cta { margin-left: auto; }
  .sim-app { min-height: 360px; }
  .sim-card .cols { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .sim-in, .sx tr.new td, .sim-caret, .sim-think i { animation: none !important; }
  .sim-node { transition: none; }
}
.v2-acts details.no-chips summary { cursor: default; }
.v2-acts details.no-chips summary:hover { background: transparent; }

.sim-sum { background: #fff; border: 1px solid var(--surface-2); border-radius: 12px; padding: 14px; font-size: 13px; color: var(--ink-2); }
.sim-sum .hd { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.sim-sum .hd svg { width: 16px; height: 16px; }
.sim-sum .lbl { font-size: 11.5px; font-weight: 700; color: var(--text-tertiary); margin-top: 12px; }
.sim-sum ul { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.sim-sum li { display: flex; align-items: center; gap: 8px; }
.sim-sum .nx { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--surface-2); color: var(--ink); font-weight: 600; }
@media (max-width: 767px) { .sim-body { height: auto; max-height: none; } }

/* ── fix v2b (QA v2 + SEO v2 reviews, 2026-10-08) ─────────────────────── */
/* QA minor 4: the empty feed shows a "New chat" greeting until the message is sent */
.sim-hello { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: #55534d; font-size: 13.5px; max-width: 320px; padding: 24px 0; }
.sim-hello img { background: var(--ink); border-radius: 8px; padding: 5px; }
.sim-hello b { color: #1c1a14; font-size: 16px; }
.sim-first p { background: #f6f5f2; border-radius: 12px; padding: 9px 12px; font-size: 13.5px; }
/* several approval cards stack, newest on top; older ones fade */
.sim-appr { display: flex; flex-direction: column; gap: 8px; }
.sim-appr .sim-card.is-old { opacity: .6; }
.sim-appr .sim-card.is-old .desc { display: none; }
/* modal title: a labelled div, not an H2 in the static HTML (SEO v2 defect 5) */
.sim-head .sim-ttl { font-size: 18px; font-weight: 800; letter-spacing: -.015em; color: var(--ink); line-height: 1.25; }
@media (max-width: 767px) {
  .sim-head .sim-ttl { font-size: 16px; }
  /* QA minor 5: on phones the sheet mock keeps only its key columns, and the run summary sits above it, short */
  .sx .mh { display: none; }
  .sim-res-grid.two .sim-sum { order: -1; }
  .sim-sum .rd { display: none; }
  .sim-sum { padding: 10px 12px; }
  .sim-sum .lbl { margin-top: 8px; }
}
/* QA minor 8: the Guide pin sits inside the tile, never clipped */
.v2-cell .pin { top: 5px; right: 5px; }
@media (max-width: 480px) { .v2-cell .pin { top: 4px; right: 4px; font-size: 9px; padding: 0 5px; } .v2-cell { padding-top: 18px; } }
/* QA minor 9: hero stat chips as an even grid, no orphan */
.v2-stats.is-grid { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: 10px; }
@media (min-width: 1024px) { .v2-stats.is-grid.n4 { grid-template-columns: repeat(4, max-content); } .v2-stats.is-grid.n4 .v2-stat { padding: .5rem .7rem; font-size: 12.5px; } .v2-stats.is-grid.n4 .v2-stat b { font-size: 18px; } }
@media (min-width: 1024px) and (max-width: 1279px) { .v2-stats.is-grid.n4 { grid-template-columns: repeat(2, max-content); } }
/* QA minor 6: one guide is a full-width featured strip */
.v2-strip { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 22px; border-radius: 16px; padding: 22px 26px; background: #fff; border: 1px solid var(--neutral); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.v2-strip:hover { border-color: var(--ink); box-shadow: 0 18px 40px rgba(28,26,20,.08); }
.v2-strip .wash { position: absolute; left: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: color-mix(in srgb, var(--b) 12%, transparent); }
.v2-strip .go { width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: var(--secondary); display: inline-flex; align-items: center; justify-content: center; }
@media (max-width: 640px) { .v2-strip { grid-template-columns: 1fr; gap: 14px; padding: 18px; } .v2-strip .go { display: none; } }
/* QA minor 13: small Private App chip on event cards (note lives once in the group subtitle) */
.v2-pa { display: inline-flex; align-items: center; gap: .3rem; font-size: 11.5px; font-weight: 600; color: var(--ink-2); border: 1px dashed var(--neutral); border-radius: 99px; padding: .05rem .55rem; }
/* QA minor 11: "Make it yours" chips open the matching simulation */
.v2-var { display: flex; align-items: flex-start; gap: 12px; text-align: left; width: 100%; background: #fff; border: 1px solid var(--neutral); border-radius: 14px; padding: 14px 16px; font-size: 14.5px; line-height: 1.55; color: var(--ink); cursor: pointer; transition: border-color .15s; }
.v2-var:hover { border-color: var(--ink); }
.v2-var .pl { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--secondary); display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.v2-var .pl svg { width: 9px; height: 9px; margin-left: 2px; }
.v2-var small { display: block; font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }
/* QA minor 3: the guide as visual steps; long answers fold on phones */
.v2-guide-grid { display: grid; gap: 14px; }
@media (min-width: 768px) { .v2-guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: row dense; } }
.v2-gcard { background: #fff; border: 1px solid var(--neutral); border-radius: 16px; padding: 22px; }
.v2-gcard .gi { width: 40px; height: 40px; border-radius: 12px; background: var(--secondary); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; }
.v2-gcard .gi svg { width: 20px; height: 20px; }
.v2-gcard h2 { margin-top: 14px; font-size: 20px; font-weight: 800; letter-spacing: -.015em; color: var(--ink); line-height: 1.25; }
.v2-gcard .lead { margin-top: 8px; font-size: 15px; line-height: 1.65; color: var(--ink-2); }
.v2-gcard .more p { margin-top: 10px; font-size: 14.5px; line-height: 1.65; color: var(--ink-2); }
.v2-gcard .more-t { display: none; }
.v2-qs { margin-top: 12px; display: grid; gap: 8px; }
.v2-qs li { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.v2-qs li .n { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--secondary); font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.v2-gstats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.v2-gstats span { background: var(--surface); border-radius: 10px; padding: 6px 10px; font-size: 12.5px; color: var(--text-tertiary); }
.v2-gstats b { display: block; font-size: 17px; font-weight: 800; color: var(--ink); }
.v2-gcard.wide { grid-column: 1 / -1; }
@media (max-width: 767px) {
  .v2-gcard .more-t { display: inline-flex; align-items: center; gap: .35rem; margin-top: 10px; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--neutral); }
  .v2-gcard:not(.is-open) .more { display: none; }
  .v2-gcard.is-open .more-t { display: none; }
}
/* QA minor 12: hero buttons are one height (48px) everywhere */
.v2-run.is-lg { min-height: 48px; padding-left: 1.1rem; padding-right: 1.3rem; font-size: 15px; }
.ih-pill-cta.is-hero { min-height: 48px; }
/* v2c: read approval tick (one per app) is lighter than the write tick */
.v2-flow .st.ok.rd { background: transparent; border-color: var(--secondary); }

/* v2c QA M1: action rows wrap on phones so the name/description use the full width */
@media (max-width: 640px) {
  .v2-acts summary { flex-wrap: wrap; row-gap: 6px; column-gap: 10px; padding: 12px 14px; }
  .v2-acts summary > div:first-child { order: 1; flex: 1 1 calc(100% - 34px); min-width: 0; }
  .v2-acts summary .chev { order: 2; align-self: flex-start; margin-top: 3px; }
  .v2-acts summary .bar { display: none; }
  .v2-acts summary .ih-badge { order: 3; }
  .v2-acts ul { padding: 0 14px 12px; }
}
/* v2c QA m3: the Private App chip hugs its text */
.v2-job .v2-pa, .v2-pa { align-self: flex-start; width: max-content; max-width: 100%; }
/* v2c QA M2: cap the hero copy column so the orbit keeps >= 420px; 4 stat chips sit as an even 2 x 2 */
@media (min-width: 1024px) {
  .v2-hero-grid { grid-template-columns: minmax(0, 600px) minmax(440px, 1fr) !important; }
  .v2-hero-grid .v2-stats.is-grid.n4 { grid-template-columns: repeat(2, max-content); }
}
/* v2c QA m4: pair hero, 3 chips in one row on wide screens */
@media (min-width: 1280px) { .v2-stats.is-grid.n3 { grid-template-columns: repeat(3, max-content); } .v2-stats.is-grid.n3 .v2-stat { padding: .5rem .75rem; font-size: 12.5px; } .v2-stats.is-grid.n3 .v2-stat b { font-size: 18px; } }
/* v2c QA m9: category pills fit in two rows at desktop */
@media (min-width: 1024px) { #cat-pills { gap: 6px; } #cat-pills .v2-chip { padding-left: .7rem; padding-right: .7rem; } }
/* v2c QA m10: guide stat chips as an even row of 3 */
.v2-gstats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.v2-gstats span { min-width: 0; }
/* v2c QA m5: the dialog box takes focus on open without a ring */
.sim-box:focus { outline: none; }
/* v2c QA m6: inline approval cards on phones, under their node in the flow */
.sim-flow .sim-card.is-inline { margin: 6px 0 2px 18px; box-shadow: 0 6px 18px rgba(28,26,20,.10); }
.sim-flow .sim-card.is-inline.is-old .desc { display: none; }
@media (max-width: 767px) { .sim-flow-wrap .sim-appr:empty { display: none; } }
/* v2c QA m7: phone result tables never scroll sideways: long cells wrap */
@media (max-width: 767px) { .sx td { white-space: normal; overflow-wrap: anywhere; } .sx tr.hdr td { white-space: nowrap; } }

/* Sam 2026-10-10: "See it run" on phones looked broken while the workflow played (active card pushed to the
   right edge, tick badges clipped, approval card squeezed against the edge with a long tool id wrapping).
   Calm, contained layout: nothing moves sideways, every card keeps the same inner gutter. */
@media (max-width: 767px) {
  .sim-flow { padding: 10px 0 4px 0; }
  .sim-node { padding: 10px 12px; gap: 10px; }
  .sim-node.is-on { transform: none; box-shadow: 0 4px 14px rgba(28,26,20,.08); }
  .sim-node .tick { right: 6px; top: -8px; }
  .sim-node .nic { width: 34px; height: 34px; }
  .sim-node .nl { font-size: 13.5px; }
  .sim-node .kd { font-size: 10.5px; }
  .sim-flow .sim-card.is-inline { margin: 10px 0 0 0; padding: 12px; font-size: 12.5px; box-shadow: 0 4px 14px rgba(28,26,20,.08); }
  .sim-flow .sim-card.is-inline + .sim-node { margin-top: 14px; }
  .sim-flow .sim-card.is-inline + .sim-node::before { display: none; }
  .sim-card .hd { font-size: 13px; }
  .sim-card .hd b { overflow-wrap: anywhere; }
  .sim-card .btns, .sim-card .desc, .sim-card .cols { padding-left: 0; }
  .sim-side { margin-top: 18px; }
}
