/* "See a Worker in Action" (enterprise.html#ent-demo), rendered by assets/js/enterprise.js.
   Look ported from the retired team-rollout walkthrough: department tab bar, sidebar, numbered headings,
   dot stepper, prompt bar with Run, tinted KPI cards, charts, other-department cards. */
:root {
  --wd-red-bg: #fdeceb; --wd-red-fg: #c5362c;
  --wd-blue-bg: #eaf1fe; --wd-blue-fg: #1662e8;
  --wd-amber-bg: #fdf3e2; --wd-amber-fg: #a86e05;
  --wd-green-bg: #e3f5ec; --wd-green-fg: #1f7a4d;
  --wd-ico-bg: rgba(255, 255, 255, 0.75);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --wd-red-bg: #3a2222; --wd-red-fg: #f08a80;
    --wd-blue-bg: #1f2849; --wd-blue-fg: #9db6ff;
    --wd-amber-bg: #3a3018; --wd-amber-fg: #e2b04a;
    --wd-green-bg: #17332a; --wd-green-fg: #5cc98f;
    --wd-ico-bg: rgba(0, 0, 0, 0.25);
  }
}
:root[data-theme="dark"] {
  --wd-red-bg: #3a2222; --wd-red-fg: #f08a80;
  --wd-blue-bg: #1f2849; --wd-blue-fg: #9db6ff;
  --wd-amber-bg: #3a3018; --wd-amber-fg: #e2b04a;
  --wd-green-bg: #17332a; --wd-green-fg: #5cc98f;
  --wd-ico-bg: rgba(0, 0, 0, 0.25);
}

.wd { display: flex; flex-direction: column; gap: 18px; }
.wd h4 { margin: 0; font-size: 1rem; }
.wd-head h2 { margin: 0 0 4px; }
.wd-head p { margin: 0; }

/* Department tab bar */
.wd-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 6px 14px 0; box-shadow: var(--shadow); }
.wd-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.wd-tabs button { display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border: 0; border-bottom: 3px solid transparent; border-radius: 10px 10px 0 0; background: transparent; color: var(--text); font: 500 0.95rem var(--font); cursor: pointer; }
.wd-tabs button .ico { color: var(--muted); }
.wd-tabs button:hover { background: var(--surface-2); }
.wd-tabs button.on { background: var(--accent-soft); color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.wd-tabs button.on .ico { color: var(--accent); }
.wd-company { display: inline-flex; align-items: center; gap: 10px; font-size: 0.78rem; color: var(--muted); line-height: 1.3; padding-bottom: 6px; }
.wd-company b { color: var(--text); }
.wd-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; font-size: 0.75rem; color: var(--text); }
@media (max-width: 700px) {
  .wd-bar { padding: 6px 6px 0; }
  .wd-company { display: none; }
  .wd-tabs { width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .wd-tabs button { flex-direction: column; gap: 4px; padding: 10px 4px; font-size: 0.8rem; }
}

/* Layout: sidebar + main */
.wd-layout { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .wd-layout { grid-template-columns: 270px minmax(0, 1fr); } }
@media (max-width: 999px) { .wd-side { order: 2; } }

/* Sidebar */
.wd-side { background: color-mix(in srgb, var(--accent) 3%, var(--surface)); border: 1px solid var(--line); border-radius: 14px; padding: 20px 16px; align-self: start; display: flex; flex-direction: column; gap: 10px; }
.wd-side h3 { margin: 0; font-size: 1.1rem; }
.wd-side .wd-side-h2 { margin-top: 10px; }
.wd-side > p { margin: 0 0 6px; color: var(--muted); font-size: 0.9rem; line-height: 1.45; }
.wd-side h4 { margin: 10px 0 0; font-size: 0.92rem; }
.wd-si { display: grid; grid-template-columns: 40px 1fr; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.wd-si b { display: block; font-size: 0.9rem; font-weight: 600; line-height: 1.35; }
.wd-si > div > span { font-size: 0.78rem; color: var(--muted); line-height: 1.4; }
.wd-si.tall { align-items: start; }
.wd-si-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.wd-si-ico .ico { width: 22px; height: 22px; }
.wd-si.line .wd-si-ico { background: transparent; border: 1px solid var(--line); }
.wd-si.tone-green .wd-si-ico { background: var(--wd-green-bg); color: var(--wd-green-fg); }
.wd-si.tone-amber .wd-si-ico { background: var(--wd-amber-bg); color: var(--wd-amber-fg); }
.wd-logo { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 0.85rem; }
.wd-conn { display: inline-flex; align-items: center; gap: 6px; }
.wd-conn i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.wd-knows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 0.82rem; color: var(--muted); line-height: 1.45; }
.wd-knows li { padding-left: 14px; position: relative; }
.wd-knows li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.wd-knows b { color: var(--text); font-weight: 600; }

/* Main column */
.wd-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.wd-stepper { display: flex; flex-direction: column; gap: 8px; }
.wd-dots { display: flex; align-items: center; }
.wd-dots button { width: 16px; height: 16px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: color-mix(in srgb, var(--accent) 25%, var(--surface)); flex: none; }
.wd-dots button.done { background: color-mix(in srgb, var(--accent) 55%, var(--surface)); }
.wd-dots button.cur { background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.wd-dots span { width: 72px; height: 3px; background: color-mix(in srgb, var(--accent) 20%, var(--surface)); }
.wd-dots span.done { background: var(--accent); }
.wd-h { font-size: clamp(1.7rem, 3.6vw, 2.5rem); margin: 4px 0 0; letter-spacing: -0.02em; }
.wd-lead { font-size: clamp(1rem, 1.8vw, 1.25rem); color: var(--muted); margin: 0 0 4px; }
.wd-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 18px; }
.wd-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 14px; }
.wd-foot .btn:last-child { margin-left: auto; }
.wd-back { background: none; border: 0; padding: 0; color: var(--muted); font: 500 0.95rem var(--font); cursor: pointer; }
.wd-back:hover { color: var(--accent); }
.wd-note { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0; }
.wd-note a { margin-left: auto; color: var(--muted); }

/* Step 1: prompt bar, working steps, situation vs. generic answer, other departments */
.wd-ask { display: flex; align-items: center; gap: 12px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 12px; padding: 8px; background: color-mix(in srgb, var(--accent) 3%, var(--surface)); }
.wd-ask-ico { width: 36px; height: 36px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.wd-ask-q { flex: 1; min-width: 0; font-size: 1.02rem; }
.wd-ask .btn { min-width: 96px; }
@media (max-width: 560px) { .wd-ask { flex-wrap: wrap; } .wd-ask .btn { width: 100%; } }
.wd-working { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--surface); }
.wd-working ol { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 0.92rem; color: var(--muted); }
.wd-working li { display: flex; gap: 10px; align-items: center; }
.wd-working li::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: wd-spin 0.8s linear infinite; flex: none; }
.wd-working li.done { color: var(--text); }
.wd-working li.done::before { content: "✓"; border: 0; animation: none; color: var(--ok); font-weight: 800; font-size: 0.85rem; display: grid; place-items: center; }
@keyframes wd-spin { to { transform: rotate(360deg); } }
[data-run]:disabled { opacity: 0.7; cursor: progress; }
@media (prefers-reduced-motion: reduce) { .wd-working li::before { animation: none; } }

.wd-compare { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .wd-compare { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .wd-cmp + .wd-cmp { border-left: 1px solid var(--line); padding-left: 20px; } }
.wd-cmp { display: flex; flex-direction: column; gap: 12px; }
.wd-cmp-head { display: flex; align-items: center; gap: 14px; }
.wd-cmp-head h4 { font-size: 1.1rem; }
.wd-cmp-head span { color: var(--muted); font-size: 0.9rem; }
.wd-big { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.wd-big .ico { width: 24px; height: 24px; }
.wd-big.grey { background: var(--surface-2); color: var(--text); }
.wd-ans { border-radius: 12px; padding: 14px 16px; border: 1px solid var(--line); line-height: 1.55; }
.wd-ans.grey { background: var(--surface-2); border-color: transparent; font-style: italic; }
.wd-ans.grey small { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; font-style: normal; font-size: 0.82rem; color: var(--warn); }
.wd-ans.grey small .ico { width: 16px; height: 16px; margin-top: 2px; }
.wd-ans.blue { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); font-size: 1.02rem; }

.wd-others { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); margin-top: -6px; }
.wd-other { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--surface); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.wd-other:hover { border-color: var(--accent); }
.wd-other.cur { border: 2px solid var(--accent); background: var(--accent-soft); padding: 13px; }
.wd-other b { display: block; }
.wd-other span { font-size: 0.82rem; color: var(--muted); line-height: 1.4; }
.wd-other > .ico { color: var(--muted); }
.wd-o-ico { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); }
.wd-cur-tag { display: inline-block; margin-top: 6px; font-style: normal; font-size: 0.72rem; font-weight: 600; background: color-mix(in srgb, var(--accent) 18%, var(--surface)); color: var(--accent); padding: 2px 8px; border-radius: 999px; }

/* Step 2: numbered steps, evidence table, rules (sidebar) */
.wd-si.tint .wd-si-ico { background: var(--wd-blue-bg); color: var(--wd-blue-fg); }
.wd-expect { border: 1px solid var(--line); border-radius: 12px; padding: 18px; background: color-mix(in srgb, var(--accent) 3%, var(--surface)); }
.wd-expect h4 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 1.05rem; }
.wd-expect h4 .ico { color: var(--accent); }
.wd-expect ol { list-style: none; counter-reset: wd; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
.wd-expect li { counter-increment: wd; display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; align-items: start; align-content: start; }
.wd-expect li::before { content: counter(wd); grid-row: span 2; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: grid; place-items: center; }
.wd-expect li b { font-size: 0.95rem; font-weight: 600; }
.wd-expect li span { font-size: 0.84rem; color: var(--muted); line-height: 1.45; }
.wd-tbl { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.wd-tbl h4 { padding: 12px 16px; font-size: 1.05rem; }
.wd-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.wd-table th { text-align: left; background: var(--surface-2); font-weight: 600; padding: 9px 14px; }
.wd-table td { padding: 10px 14px; border-top: 1px solid var(--line); }
.wd-table td:first-child { font-weight: 600; white-space: nowrap; }
.wd-tip { display: flex; align-items: center; gap: 10px; margin: 0; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 0.92rem; border-radius: 12px; padding: 10px 16px; }

/* Step 3: result, tinted KPIs, charts, actions + book card */
.wd-result { border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 16px; animation: wd-fade 0.5s ease; }
@keyframes wd-fade { from { opacity: 0.2; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .wd-result { animation: none; } }
.wd-res-head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; }
.wd-res-head h4 { font-size: 1.1rem; margin-bottom: 2px; }
.wd-upd { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.wd-upd .ico { width: 14px; height: 14px; }
@media (max-width: 640px) { .wd-res-head { grid-template-columns: auto 1fr; } .wd-upd { grid-column: 1 / -1; } }
.wd-kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); }
.wd-kpi { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; border-radius: 12px; padding: 14px; }
.wd-kpi-ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--wd-ico-bg); }
.wd-kpi-ico .ico { width: 24px; height: 24px; }
.wd-kpi.red { background: var(--wd-red-bg); } .wd-kpi.red .wd-kpi-ico { color: var(--wd-red-fg); }
.wd-kpi.blue { background: var(--wd-blue-bg); } .wd-kpi.blue .wd-kpi-ico { color: var(--wd-blue-fg); }
.wd-kpi.amber { background: var(--wd-amber-bg); } .wd-kpi.amber .wd-kpi-ico { color: var(--wd-amber-fg); }
.wd-kpi.green { background: var(--wd-green-bg); } .wd-kpi.green .wd-kpi-ico { color: var(--wd-green-fg); }
.wd-kpi-l { display: block; font-size: 0.85rem; font-weight: 600; }
.wd-kpi b { display: block; font-size: 1.55rem; letter-spacing: -0.01em; line-height: 1.25; }
.wd-kpi-d { display: block; font-size: 0.8rem; color: var(--muted); }

.wd-charts { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr)); }
.wd-chart { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; min-width: 0; overflow: hidden; }
.wd-chart h4 { margin-bottom: 8px; font-size: 0.95rem; }
.wd-chart .chart { width: 100%; height: auto; display: block; }
.wd-chart .chart .grid { stroke: var(--line); stroke-width: 1; }
.wd-chart .chart .tick { font-size: 10px; fill: var(--muted); }
.wd-chart .chart .val { font-size: 11px; font-weight: 700; fill: var(--text); }
.wd-chart .donut-wrap { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 14px; align-items: center; }
.wd-chart .donut { width: 130px; height: 130px; }
.wd-chart .d-total { font-size: 16px; font-weight: 800; fill: var(--text); }
.wd-chart .d-sub { font-size: 10px; fill: var(--muted); }
.wd-chart .legend { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.wd-chart .legend td { padding: 5px 4px; }
.wd-chart .legend td:nth-child(n+2) { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wd-chart .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
@media (max-width: 460px) { .wd-chart .donut-wrap { grid-template-columns: 1fr; justify-items: center; } }

.wd-expect-row { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .wd-expect-row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } }
.wd-expect-row .wd-expect ol { grid-template-columns: 1fr; gap: 10px; }
.wd-expect li.act { grid-template-columns: 34px 1fr auto; align-items: center; column-gap: 10px; }
.wd-expect li.act::before { grid-row: auto; }
.wd-expect li.act b { font-weight: 500; font-size: 0.92rem; }
.wd-prio { display: inline-block; min-width: 64px; text-align: center; padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }
.wd-prio.hi { background: var(--wd-red-bg); color: var(--wd-red-fg); }
.wd-prio.md { background: var(--wd-amber-bg); color: var(--wd-amber-fg); }
.wd-book { background: linear-gradient(135deg, #1662e8, #0f4fd0); color: #fff; border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.wd-book-head { display: grid; grid-template-columns: auto 1fr; gap: 14px; }
.wd-book-ico { width: 50px; height: 50px; border-radius: 12px; background: rgba(255, 255, 255, 0.15); display: grid; place-items: center; }
.wd-book-ico .ico { width: 26px; height: 26px; }
.wd-book h4 { margin: 0 0 4px; font-size: 1.25rem; }
.wd-book p { margin: 0; font-size: 0.88rem; opacity: 0.92; line-height: 1.5; }
.wd-book-primary { background: #fff; color: #1662e8; }
.wd-book-primary:hover { background: #eef4ff; }
.wd-book-secondary { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, 0.8); }
.wd-book-secondary:hover { background: rgba(255, 255, 255, 0.1); }

/* Step 3: success criteria the outcome was checked against */
.wd-crit { border: 1px solid color-mix(in srgb, var(--wd-green-fg) 30%, var(--line)); background: var(--wd-green-bg); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.wd-crit h4 { display: flex; align-items: center; gap: 8px; font-size: 1rem; }
.wd-crit h4 .ico { color: var(--wd-green-fg); }
.wd-crit ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px 18px; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.wd-crit li { position: relative; padding-left: 24px; font-size: 0.88rem; line-height: 1.45; }
.wd-crit li::before { content: "✓"; position: absolute; left: 0; top: 1px; width: 17px; height: 17px; border-radius: 50%; background: var(--wd-green-fg); color: var(--surface); font-size: 0.65rem; font-weight: 800; display: grid; place-items: center; }
.wd-crit a { align-self: flex-start; color: var(--wd-green-fg); }
/* Five department tabs on phones */
@media (max-width: 700px) { .wd-tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); } .wd-tabs button { font-size: 0.7rem; padding: 10px 2px; } }

/* Prompt AI Worker: the worker instructions pasted before the request */
.wd-paste { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface-2); }
.wd-paste .ico { color: var(--accent); margin-top: 2px; }
.wd-paste b { display: block; font-size: 0.9rem; }
.wd-paste span { font-size: 0.82rem; color: var(--muted); }
.wd-head .vt { margin-top: 10px; }
.wd-ans.grey .wd-run-cta { margin-top: 12px; font-style: normal; white-space: normal; text-align: left; }
