/* Demo-only layer over the workspace stylesheet: the demo bar, domain
   picker, connector, live stage strip and the guided tour. Same palette
   and type as workspace.css; nothing here changes a workspace class. */

:root {
  --ws-ink: #242424; --ws-muted: #737373; --ws-line: #ececec; --ws-card: #ffffff;
  --ws-green: #262626; --ws-green-deep: #111111; --ws-amber: #8c6227; --ws-amber-bg: #faf4e9;
  --ws-red: #a23e38; --ws-red-bg: #f8e8e5; --ws-focus: #737373;
}
body { margin: 0; background: #fff; font: 14px/1.6 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ws-ink); }
.ws-overlay, .ws-overlay *, .ws-evidence-overlay *, .dm-overlay *, .dm-tip, .dm-tip * { box-sizing: border-box; }

/* ── Demo bar ── */
.dm-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 9px 36px; font-size: 12px; color: var(--ws-muted);
  background: rgba(255, 255, 255, 0.94); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--ws-line);
}
.dm-bar b { color: var(--ws-ink); font-weight: 600; }
.dm-bar-tag { background: #242424; color: #fff; border-radius: 20px; padding: 3px 10px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.2px; }
.dm-bar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.dm-bar-actions .ws-quiet-btn { font-size: 12px; }
.dm-bar-cta { background: #242424; color: #fff !important; text-decoration: none; border-radius: 20px; padding: 6px 14px; font-weight: 600; font-size: 12px; }
.dm-bar-cta:hover { background: #111; }

/* ── Domain picker ── */
.dm-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(20, 20, 20, 0.42); display: grid; place-items: center; padding: 20px; }
.dm-picker { position: relative; background: #fff; border-radius: 18px; max-width: 860px; width: 100%; padding: 34px 36px 26px; box-shadow: 0 24px 80px rgba(0,0,0,.25); animation: dm-rise 260ms cubic-bezier(.2,.7,.2,1) both; }
.dm-picker h2 { font: 600 26px/1.25 Inter, -apple-system, sans-serif; letter-spacing: -0.8px; margin: 6px 0 8px; }
.dm-picker > p { color: var(--ws-muted); font-size: 13.5px; margin: 0 0 22px; max-width: 660px; }
.dm-picker-x { position: absolute; top: 16px; right: 16px; }
.dm-eyebrow { font-size: 11px; color: #858585; }
.dm-domains { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.dm-domain { text-align: left; border: 1px solid #e6e6e6; background: #fff; border-radius: 14px; padding: 18px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; font: inherit; color: inherit; transition: border-color 120ms, box-shadow 120ms, transform 120ms; }
.dm-domain:hover, .dm-domain:focus-visible { border-color: #242424; box-shadow: 0 6px 24px rgba(0,0,0,.08); transform: translateY(-1px); outline: none; }
.dm-domain b { font-size: 16px; font-weight: 600; }
.dm-domain small { color: var(--ws-muted); font-size: 12.5px; line-height: 1.5; }
.dm-domain-ins { margin-top: auto; padding-top: 8px; font-size: 11px; color: #9a9a9a; }
.dm-domain-ico { width: 38px; height: 38px; border-radius: 10px; background: #f3f3f3; display: grid; place-items: center; }
.dm-domain-ico svg { width: 20px; height: 20px; stroke: #242424; stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.dm-fine { font-size: 11.5px; color: #9a9a9a; margin: 18px 0 0; }
@keyframes dm-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── Live stage strip and trace ── */
.dm-stages { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dm-stage { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 5px 11px; border-radius: 20px; border: 1px solid var(--ws-line); color: #9a9a9a; background: #fff; }
.dm-stage-done { color: var(--ws-ink); background: #f4f4f4; border-color: #f4f4f4; }
.dm-stage-run { color: var(--ws-amber); background: var(--ws-amber-bg); border-color: #f0e2c6; font-weight: 600; }
.dm-stage-sep { color: #c4c4c4; font-size: 12px; }
.dm-spin { width: 11px; height: 11px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; display: inline-block; animation: dm-spin 0.8s linear infinite; flex: none; }
@keyframes dm-spin { to { transform: rotate(360deg); } }
.dm-tick { color: #3f7a55; font-weight: 700; display: inline-block; width: 11px; }
.dm-trace { margin-top: 12px; display: grid; gap: 6px; }
.dm-trace-row { display: grid; grid-template-columns: 130px 1fr; gap: 12px; font-size: 12.5px; color: #555; animation: dm-rise 240ms ease both; }
.dm-trace-row b { font-weight: 600; color: var(--ws-ink); }

/* ── Connector ── */
.dm-connector h2 { margin-bottom: 4px; }
.dm-sources { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.dm-source { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; padding: 6px 12px; border: 1px solid var(--ws-line); border-radius: 20px; background: #fafafa; }
.dm-live { width: 7px; height: 7px; border-radius: 50%; background: #4f9a6a; box-shadow: 0 0 0 3px rgba(79,154,106,.15); }
.dm-fetchlog { margin-top: 12px; display: grid; gap: 4px; }
.dm-fetchlog:empty { display: none; }
.dm-logline { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: #555; animation: dm-rise 200ms ease both; }
.dm-logline .dm-spin { color: var(--ws-amber); }

.dm-inlist { border: 1px solid var(--ws-line); border-radius: 14px; overflow: hidden; }
.dm-inrow { display: grid; grid-template-columns: 82px 1fr 170px 150px; gap: 16px; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--ws-line); animation: dm-rise 260ms ease both; }
.dm-inrow:last-child { border-bottom: 0; }
.dm-inrow-time { font-size: 13px; font-weight: 600; display: flex; flex-direction: column; }
.dm-inrow-time small, .dm-inrow-type small, .dm-inrow-act small { font-size: 11px; color: var(--ws-muted); font-weight: 400; }
.dm-inrow-subj { font-weight: 600; font-size: 13.5px; }
.dm-inrow-from { font-size: 12px; color: var(--ws-muted); }
.dm-inrow-match { font-size: 11.5px; color: var(--ws-muted); margin-top: 5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dm-inrow-type, .dm-inrow-act { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.dm-inrow-act .ws-btn { text-decoration: none; white-space: nowrap; }
.dm-type { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 6px; background: #f2f2f2; }
.dm-type-preauth { background: #eef2f7; color: #2d4a6b; }
.dm-type-settlement { background: #f5f0e6; color: #7a5a22; }
.dm-type-fastlane { background: #edf5ef; color: #2f6a45; }

/* ── Small controls ── */
.dm-filter, .dm-input { font: inherit; font-size: 12px; border: 1px solid #dedede; border-radius: 9px; padding: 5px 9px; background: #fff; color: var(--ws-ink); }
.dm-input { font-size: 13px; padding: 8px 12px; border-radius: 10px; }
.dm-gate { display: grid; gap: 8px; margin-top: 10px; }
.dm-gate-bar { height: 8px; border-radius: 6px; background: #efefef; overflow: hidden; }
.dm-gate-bar span { display: block; height: 100%; background: #668b74; border-radius: 6px; }
.dm-mine td { background: #fbfaf6; }

/* ── Guided tour ── */
.dm-spot { position: fixed; z-index: 70; border-radius: 12px; pointer-events: none; box-shadow: 0 0 0 9999px rgba(20, 20, 20, 0.36); transition: all 220ms cubic-bezier(.2,.7,.2,1); outline: 2px solid rgba(255,255,255,.85); }
.dm-spot-full { inset: 0; border-radius: 0; outline: 0; box-shadow: none; background: rgba(20, 20, 20, 0.36); }
.dm-tip { position: fixed; z-index: 71; width: 320px; background: #fff; border-radius: 14px; padding: 16px 18px 14px; box-shadow: 0 18px 50px rgba(0,0,0,.22); font-size: 13px; animation: dm-rise 220ms ease both; }
.dm-tip-center { left: 50% !important; top: 50% !important; transform: translate(-50%, -50%); width: 380px; animation: none; }
.dm-tip b { display: block; font-size: 15px; font-weight: 600; margin: 2px 0 4px; letter-spacing: -0.2px; }
.dm-tip p { margin: 0; color: #555; line-height: 1.55; }
.dm-tip-count { font-size: 10.5px; color: #9a9a9a; }
.dm-tip-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.dm-tip-skip { border: 0; background: none; color: #9a9a9a; font: inherit; font-size: 12px; cursor: pointer; padding: 4px 0; }
.dm-tip-skip:hover { color: var(--ws-ink); }
.dm-tip-next { border: 0; background: #242424; color: #fff; font: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 14px; border-radius: 20px; cursor: pointer; }
.dm-tip-wait { font-size: 12px; font-weight: 600; color: var(--ws-amber); }

@media (max-width: 900px) {
  .dm-domains { grid-template-columns: 1fr; }
  .dm-inrow { grid-template-columns: 1fr; }
  .dm-bar { padding: 9px 16px; flex-wrap: wrap; }
}

/* Text previews keep their monospace layout instead of wrapping. */
.ws-hovercard pre { white-space: pre; overflow: hidden; text-overflow: ellipsis; }

/* ── Phone screen (js/pages/mobile.js) ── */
.dm-m { max-width: 560px; margin: 0 auto; padding: 28px 20px 40px; color: var(--ws-ink); }
.dm-m-brand { font: 600 22px/1.2 Inter, -apple-system, sans-serif; letter-spacing: -1px; display: flex; flex-direction: column; gap: 4px; }
.dm-m-brand span { font-size: 11px; font-weight: 400; letter-spacing: 0; color: #858585; }
.dm-m h1 { font: 600 27px/1.2 Inter, -apple-system, sans-serif; letter-spacing: -0.8px; margin: 26px 0 10px; }
.dm-m h2 { font-size: 15px; font-weight: 600; margin: 30px 0 12px; letter-spacing: -0.2px; }
.dm-m-lead { font-size: 15px; line-height: 1.55; color: #555; margin: 0; }
.dm-m-note { margin: 18px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--ws-amber-bg); color: #6b4d1f; font-size: 13.5px; line-height: 1.5; }
.dm-m-note b { color: #5a3f17; }
.dm-m-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.dm-m-actions .ws-btn { flex: 1 1 200px; justify-content: center; text-align: center; text-decoration: none; font-size: 14px; padding: 12px 16px; }
.dm-m-toast { margin: 10px 0 0; font-size: 13px; color: #3f7a55; overflow-wrap: anywhere; }
.dm-m-fig { margin: 0 0 18px; }
.dm-m-fig img { display: block; width: 100%; height: auto; border: 1px solid var(--ws-line); border-radius: 12px; }
.dm-m-fig figcaption { font-size: 12.5px; color: var(--ws-muted); margin-top: 8px; line-height: 1.5; }
.dm-m-doms { display: grid; gap: 10px; }
.dm-m-dom { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--ws-line); border-radius: 12px; padding: 12px; }
.dm-m-dom b { display: block; font-size: 14px; font-weight: 600; }
.dm-m-dom small { display: block; color: var(--ws-muted); font-size: 12.5px; line-height: 1.45; }
.dm-m-dom .dm-domain-ico { flex: none; }
.dm-m-anyway { display: block; width: 100%; margin-top: 26px; padding: 12px; border: 1px solid #dedede; border-radius: 22px; background: #fff; font: inherit; font-size: 13.5px; color: var(--ws-ink); cursor: pointer; }
.dm-m-fine { font-size: 11.5px; color: #9a9a9a; text-align: center; margin: 12px 0 0; }
