/* =====================================================================
 * product-ui.css — native HTML/CSS re-creations of the real OfficeDesk.ai
 * dashboard constructs (department cards, agent nodes, delegation tree,
 * "Add a department" picker, Skills panel, Files list) plus the How-it-works
 * "product tour" row layout. Namespace: .od-* (OfficeDesk product UI).
 *
 * Rendered on the How it works page in place of screenshots: crisp at any
 * size, on-brand/themeable, animatable, and free of PII. Depends on style.css
 * tokens. Marketing PROSE stays in approved terms; these mockups mirror the
 * product's own labels (HOD / AI Employee / Online) for authenticity.
 * ===================================================================== */

/* ---- Virtual-office canvas (the ground the mockups sit on) ------------
 * Light slate ground so the operating-model section reads as a LIGHT section
 * (truer to the real dashboard canvas, which is light slate, not black). The
 * blue department card below stays as the product accent. */
.od-office-canvas {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 2.4rem 2.1rem 2.9rem;
  background:
    radial-gradient(rgba(69, 125, 191, 0.1) 1px, transparent 1px) 0 0 / 26px 26px,
    linear-gradient(155deg, #eef4fc 0%, #dbe7f6 100%);
  border: 1px solid #e2ebf6;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 22px 48px rgba(20, 67, 132, 0.1);
  overflow: hidden;
}

/* ---- Department switcher (pure-CSS radio tabs) -----------------------
 * The canvas holds one delegation tree per template department (Finance,
 * Tech, Marketing, Blog Publishing). Radios drive a tab -> panel switch via
 * the :checked ~ sibling combinator: no JS. The pill look is borrowed from
 * the theme's portfolio filter (.team-filter-menu / .filter-btn in the
 * always-loaded style.css); only the show/hide + active-tab wiring is here. */
.od-dept-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;              /* sr-only, but NOT display:none so it stays keyboard-focusable */
  pointer-events: none;
}

.od-dept-switch .team-filter-menu-wrap {
  margin-bottom: 1.7rem;
}

.od-dept-tabs {
  flex-wrap: wrap;         /* tabs wrap to a tidy block on narrow screens */
}

.od-dept-switch .filter-btn {
  cursor: pointer;         /* labels behave as buttons */
}

.od-dept-switch .filter-btn i {
  margin-right: 0.4rem;
  opacity: 0.85;
}

/* Group divider: the tabs after it are custom-built examples, not shipped
 * templates. Non-interactive; on wrap it reads as a small group header. */
.od-tab-sep {
  align-self: center;
  margin-left: 0.35rem;
  padding-left: 0.75rem;
  border-left: 1px solid rgba(20, 67, 132, 0.16);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6b7f9c;
  white-space: nowrap;
  cursor: default;
}

/* Panels: only the checked department is shown. One selector per dept. */
.od-dept-panel {
  display: none;
}
#od-dept-finance:checked   ~ .od-dept-panels .od-dept-panel[data-dept="finance"],
#od-dept-tech:checked      ~ .od-dept-panels .od-dept-panel[data-dept="tech"],
#od-dept-marketing:checked ~ .od-dept-panels .od-dept-panel[data-dept="marketing"],
#od-dept-blog:checked      ~ .od-dept-panels .od-dept-panel[data-dept="blog"],
#od-dept-support:checked   ~ .od-dept-panels .od-dept-panel[data-dept="support"],
#od-dept-hr:checked        ~ .od-dept-panels .od-dept-panel[data-dept="hr"] {
  display: block;
}

/* Active tab: mirror .filter-btn.active (style.css) for the checked dept. */
#od-dept-finance:checked   ~ .team-filter-menu-wrap label[for="od-dept-finance"],
#od-dept-tech:checked      ~ .team-filter-menu-wrap label[for="od-dept-tech"],
#od-dept-marketing:checked ~ .team-filter-menu-wrap label[for="od-dept-marketing"],
#od-dept-blog:checked      ~ .team-filter-menu-wrap label[for="od-dept-blog"],
#od-dept-support:checked   ~ .team-filter-menu-wrap label[for="od-dept-support"],
#od-dept-hr:checked        ~ .team-filter-menu-wrap label[for="od-dept-hr"] {
  background: var(--secondary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(20, 67, 132, 0.18);
}

/* Keyboard focus ring on the label of the focused radio. */
#od-dept-finance:focus-visible   ~ .team-filter-menu-wrap label[for="od-dept-finance"],
#od-dept-tech:focus-visible      ~ .team-filter-menu-wrap label[for="od-dept-tech"],
#od-dept-marketing:focus-visible ~ .team-filter-menu-wrap label[for="od-dept-marketing"],
#od-dept-blog:focus-visible      ~ .team-filter-menu-wrap label[for="od-dept-blog"],
#od-dept-support:focus-visible   ~ .team-filter-menu-wrap label[for="od-dept-support"],
#od-dept-hr:focus-visible        ~ .team-filter-menu-wrap label[for="od-dept-hr"] {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- Toolbar self-demo popovers (Connections + Files) ----------------
 * The two remaining toolbar chips each drop a small white popover that
 * loops through a feature demo: Connections rows connect in sequence
 * (Connect -> green Connected), then Files uploads a file (bar fills ->
 * check). Decorative, pure CSS. One shared 18s clock; the two popovers
 * take alternating visibility windows so only one shows at a time (no
 * overlap, nothing covers the delegation tree). Tool/file sets vary per
 * department (rendered by od_hiw_toolbar() in the template). */
.od-chip-cx,
.od-chip-fx {
  position: relative;
  overflow: visible;
}

.od-chip-pop {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  width: 234px;
  padding: 0.6rem 0.65rem 0.7rem;
  border-radius: 12px;
  background: #fff;
  color: #1f3350;
  text-align: left;
  font-weight: 500;
  box-shadow: 0 18px 38px rgba(15, 32, 60, 0.28);
  border: 1px solid #e6eef8;
  opacity: 0;
  pointer-events: none;      /* decorative: never intercept interaction */
  z-index: 6;
}

.od-chip-pop::before {         /* small pointer up toward the chip */
  content: "";
  position: absolute;
  top: -5px;
  right: 24px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-left: 1px solid #e6eef8;
  border-top: 1px solid #e6eef8;
  transform: rotate(45deg);
}

.od-pop-head {
  display: block;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #6b7f9c;
  margin-bottom: 0.45rem;
}
.od-pop-head i { margin-right: 0.3rem; }

/* Connections rows */
.od-cx-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.34rem 0.15rem;
  font-size: 12px;
  border-top: 1px solid #f0f4fa;
}
.od-cx-row:first-of-type { border-top: 0; }
.od-cx-tool {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #26364f;
  white-space: nowrap;
}
.od-cx-tool i { width: 15px; text-align: center; color: #4a6fa5; }
.od-cx-state { position: relative; min-width: 84px; height: 20px; }
.od-cx-connect,
.od-cx-done {
  position: absolute;
  right: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  height: 20px;
  padding: 0 0.5rem;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.od-cx-connect { color: var(--primary); background: #fff; border: 1px solid rgba(69, 125, 191, 0.4); }
.od-cx-done {
  color: #0f7a4d;
  background: #e3f7ec;
  opacity: 0;                 /* fades in over .od-cx-connect at its turn */
  animation-duration: 18s;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
.od-cx-done i { font-size: 9px; }
.od-cx-done--1 { animation-name: odCxDone1; }
.od-cx-done--2 { animation-name: odCxDone2; }
.od-cx-done--3 { animation-name: odCxDone3; }

.od-cx-count {
  display: block;
  margin-top: 0.5rem;
  font-size: 11px;
  font-weight: 700;
  color: #0f7a4d;
  opacity: 0;
  animation: odCxCount 18s linear infinite;
}
.od-cx-count i { margin-right: 0.25rem; }

/* Files rows */
.od-fx-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.36rem 0.15rem;
  font-size: 12px;
  border-top: 1px solid #f0f4fa;
}
.od-fx-row:first-of-type { border-top: 0; }
.od-fx-name {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 1 1 auto;
  min-width: 0;
  color: #26364f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.od-fx-name i { color: #4a6fa5; }
.od-fx-track {
  flex: 0 0 46px;
  height: 5px;
  border-radius: 3px;
  background: #e8eef7;
  overflow: hidden;
}
.od-fx-bar {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  animation: odFxBar 18s linear infinite;
}
.od-fx-check {
  flex: 0 0 auto;
  color: #0f7a4d;
  font-size: 11px;
  opacity: 0;
  animation: odFxCheck 18s linear infinite;
}
.od-fx-flag { flex: 0 0 auto; color: #0f7a4d; font-size: 11px; }

/* Alternating show/hide windows on one shared 18s clock. */
.od-cx-pop { animation: odCxShow 18s ease infinite; }
.od-fx-pop { animation: odFxShow 18s ease infinite; }

@keyframes odCxShow {
  0%   { opacity: 0; transform: translateY(-6px); }
  3%   { opacity: 1; transform: translateY(0); }
  44%  { opacity: 1; transform: translateY(0); }
  48%  { opacity: 0; transform: translateY(-6px); }
  100% { opacity: 0; transform: translateY(-6px); }
}
@keyframes odFxShow {
  0%, 50% { opacity: 0; transform: translateY(-6px); }
  54%     { opacity: 1; transform: translateY(0); }
  94%     { opacity: 1; transform: translateY(0); }
  98%     { opacity: 0; transform: translateY(-6px); }
  100%    { opacity: 0; transform: translateY(-6px); }
}
@keyframes odCxDone1 { 0%, 9%  { opacity: 0; } 12%, 46% { opacity: 1; } 49%, 100% { opacity: 0; } }
@keyframes odCxDone2 { 0%, 16% { opacity: 0; } 19%, 46% { opacity: 1; } 49%, 100% { opacity: 0; } }
@keyframes odCxDone3 { 0%, 25% { opacity: 0; } 28%, 46% { opacity: 1; } 49%, 100% { opacity: 0; } }
@keyframes odCxCount { 0%, 30% { opacity: 0; } 34%, 46% { opacity: 1; } 49%, 100% { opacity: 0; } }
@keyframes odFxBar   { 0%, 52% { width: 0; } 86%, 97% { width: 100%; } 100% { width: 100%; } }
@keyframes odFxCheck { 0%, 86% { opacity: 0; } 89%, 97% { opacity: 1; } 100% { opacity: 0; } }

@media (max-width: 760px) {
  .od-chip-pop { display: none; }  /* toolbar wraps small; skip the popovers */
}

/* ---- Supervisor Chat: prompt the HOD (looping demo popover) -----------
 * The HOD card gains a chat-bubble entry point (matches the real product).
 * A compact popover to the card's right loops the key interaction: your
 * plain-language task -> the manager "types" -> it delegates to a lead.
 * Own 16s clock (separate zone from the top-right toolbar popovers, so the
 * two never collide). Decorative, pure CSS, hidden on mobile. */
.od-has-chat {
  position: relative;
  overflow: visible;
  z-index: 5;                  /* lift the HOD card (+ its popover) above sibling nodes */
}

.od-hod-chatbtn {
  position: absolute;
  top: -11px;
  left: -11px;                 /* chat entry point, opposite side to the popover's target edge */
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  box-shadow: 0 6px 14px rgba(15, 32, 60, 0.24);
  pointer-events: none;
  z-index: 3;
}
.od-hod-chatbtn::after {        /* one soft ping as the chat opens each loop */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(167, 93, 236, 0.5);
  animation: odChatPing 16s ease-out infinite;
}

.od-chat-pop {
  position: absolute;
  top: -8px;
  right: calc(100% + 18px);    /* opens into the empty space left of the HOD */
  width: 250px;
  padding: 0.62rem 0.7rem 0.72rem;
  border-radius: 14px;
  background: #fff;
  color: #1f3350;
  text-align: left;
  font-weight: 500;
  box-shadow: 0 20px 42px rgba(15, 32, 60, 0.3);
  border: 1px solid #e6eef8;
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  animation: odChatShow 16s ease infinite;
}
.od-chat-pop::before {          /* pointer back toward the HOD card (on the right edge) */
  content: "";
  position: absolute;
  top: 26px;
  right: -6px;
  width: 11px;
  height: 11px;
  background: #fff;
  border-top: 1px solid #e6eef8;
  border-right: 1px solid #e6eef8;
  transform: rotate(45deg);
}

.od-chat-user {
  display: block;
  margin: 0.1rem 0 0.55rem auto;
  max-width: 88%;
  padding: 0.42rem 0.55rem;
  border-radius: 11px 11px 3px 11px;
  background: #e9f0fb;
  color: #24354e;
  font-size: 11.5px;
  line-height: 1.35;
  opacity: 0;
  animation: odChatUser 16s ease infinite;
}
.od-chat-role {
  display: block;
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.3rem;
  opacity: 0;
  animation: odChatRole 16s ease infinite;
}
.od-chat-role i { margin-right: 0.25rem; }
.od-chat-typing {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 0.36rem 0.5rem;
  border-radius: 10px;
  background: #f3eefe;
  opacity: 0;
  animation: odChatTyping 16s ease infinite;
}
.od-chat-typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #a98fe0;
  animation: odChatDot 1.1s ease-in-out infinite;
}
.od-chat-typing i:nth-child(2) { animation-delay: 0.15s; }
.od-chat-typing i:nth-child(3) { animation-delay: 0.3s; }
.od-chat-deleg {
  display: block;
  margin-top: 0.1rem;
  padding: 0.42rem 0.55rem;
  border-radius: 11px 11px 11px 3px;
  background: #e4f7ec;
  color: #0f7a4d;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.35;
  opacity: 0;
  animation: odChatDeleg 16s ease infinite;
}
.od-chat-deleg i { margin-right: 0.3rem; }

@keyframes odChatShow {
  0%        { opacity: 0; transform: translateX(6px); }
  4%        { opacity: 1; transform: translateX(0); }
  90%       { opacity: 1; transform: translateX(0); }
  96%, 100% { opacity: 0; transform: translateX(6px); }
}
@keyframes odChatUser {
  0%, 4%    { opacity: 0; transform: translateY(4px); }
  8%        { opacity: 1; transform: translateY(0); }
  88%       { opacity: 1; }
  93%, 100% { opacity: 0; }
}
@keyframes odChatRole {
  0%, 15%   { opacity: 0; }
  18%       { opacity: 1; }
  88%       { opacity: 1; }
  93%, 100% { opacity: 0; }
}
@keyframes odChatTyping {
  0%, 17%   { opacity: 0; }
  20%       { opacity: 1; }
  33%       { opacity: 1; }
  37%, 100% { opacity: 0; }
}
@keyframes odChatDeleg {
  0%, 35%   { opacity: 0; transform: translateY(4px); }
  40%       { opacity: 1; transform: translateY(0); }
  88%       { opacity: 1; }
  93%, 100% { opacity: 0; }
}
@keyframes odChatDot {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50%      { transform: translateY(-3px); opacity: 1; }
}
@keyframes odChatPing {
  0%       { box-shadow: 0 0 0 0 rgba(167, 93, 236, 0.5); }
  6%       { box-shadow: 0 0 0 8px rgba(167, 93, 236, 0); }
  8%, 100% { box-shadow: 0 0 0 0 rgba(167, 93, 236, 0); }
}

@media (max-width: 760px) {
  .od-hod-chatbtn,
  .od-chat-pop { display: none; }
}

/* ---- Department card -------------------------------------------------- */
.od-dept-card {
  position: relative;
  border-radius: 18px;
  padding: 1.4rem 1.5rem 1.75rem;
  background: linear-gradient(150deg, #3f83d9 0%, #2560ab 100%);
  box-shadow: 0 16px 34px rgba(20, 67, 132, 0.3);
  color: #fff;
}

.od-dept-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.od-dept-name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.od-spark {
  color: var(--tertiary);
  font-size: 0.9em;
  text-shadow: 0 0 10px rgba(161, 247, 254, 0.7);
}

.od-dept-desc {
  margin: 0.6rem 0 0;
  max-width: 40ch;
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.82);
}

/* Faux toolbar (Connections / Files / Edit / Delete) */
.od-dept-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.od-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: #eaf2fd;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 9px;
  white-space: nowrap;
}

.od-chip-btn.is-danger {
  color: #ffd7d3;
  border-color: rgba(255, 120, 110, 0.6);
}

/* ---- Agent node card -------------------------------------------------- */
.od-agent-card {
  width: 208px;
  max-width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid #e6edf3;
  border-radius: 14px;
  padding: 0.9rem 1rem 1rem;
  box-shadow: 0 10px 24px rgba(15, 32, 60, 0.16);
  color: #1e293b;
}

/* Manager (HOD) variant — filled blue like the product */
.od-agent-card.is-manager {
  background: linear-gradient(160deg, #67a6e8 0%, #3f83d9 100%);
  border-color: transparent;
  color: #fff;
}

.od-agent-top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.od-agent-avatar {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.05rem;
  background: #e6edf6;
  color: #7c8ba0;
}

.od-agent-card.is-manager .od-agent-avatar {
  background: #14294a;
  color: #cfe0f7;
}

.od-agent-id {
  min-width: 0;
}

.od-agent-name {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.28rem;
}

.od-agent-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.od-role-badge {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.16rem 0.45rem;
  border-radius: 5px;
}

.od-role-badge.hod {
  background: #0f2033;
  color: #dbe7f7;
}

.od-role-badge.emp {
  background: var(--primary);
  color: #fff;
}

.od-agent-card.is-manager .od-role-badge.hod {
  background: rgba(9, 20, 38, 0.55);
  color: #eaf2fd;
}

/* Supervisor = a mid-level manager (one HOD per department, many supervisors
 * beneath). Distinct mid-slate tone: darker than the AI Employee blue, lighter
 * than the single near-black HOD badge, so the three tiers read at a glance. */
.od-role-badge.sup {
  background: #274b7d;
  color: #e4eefb;
}

.od-agent-card.is-manager .od-role-badge.sup {
  background: rgba(10, 28, 56, 0.5);
  color: #eaf2fd;
}

.od-status {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  font-size: 0.68rem;
  font-weight: 500;
  color: #16a34a;
}

.od-agent-card.is-manager .od-status {
  color: #d6ffe4;
}

.od-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}

.od-agent-desc {
  margin: 0.7rem 0 0;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 0.8rem;
  line-height: 1.45;
  color: #64748b;
}

.od-agent-card.is-manager .od-agent-desc {
  color: rgba(255, 255, 255, 0.85);
  border-top-color: rgba(255, 255, 255, 0.28);
}

/* Card sizing INSIDE the delegation tree. One CONSTANT card width + gap at
 * every width (no squeeze-to-fit): the horizontal org chart keeps comfortable,
 * evenly spaced nodes and simply scrolls when the canvas is narrower than the
 * tree (the themed scrollbar handles it), then fits + centres on wide screens.
 * Uniform min-height keeps every node the same height so tiers align on one
 * row; descriptions clamp to 3 lines, echoing the real dashboard's truncated
 * cards. */
.od-tree .od-agent-card {
  width: 164px;
  min-height: 142px;
  padding: 0.62rem 0.72rem 0.68rem;
  border-radius: 12px;
  box-shadow: 0 7px 16px rgba(15, 32, 60, 0.14);
}

.od-tree .od-agent-top {
  gap: 0.45rem;
  align-items: flex-start;
}

.od-tree .od-agent-avatar {
  width: 33px;
  height: 33px;
  font-size: 0.88rem;
}

.od-tree .od-agent-name {
  font-size: 0.83rem;
  line-height: 1.14;
  margin-bottom: 0.24rem;
}

.od-tree .od-agent-meta {
  gap: 0.3rem;
}

.od-tree .od-role-badge {
  font-size: 0.5rem;
  padding: 0.1rem 0.32rem;
}

.od-tree .od-status {
  font-size: 0.58rem;
}

.od-tree .od-agent-desc {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  font-size: 0.72rem;
  line-height: 1.38;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Delegation tree (pure-CSS org chart) ----------------------------
 * Canonical nested-list tree: each nested <ul> draws a vertical drop from
 * its parent; each <li> draws half of the horizontal bus + its own drop.
 * Connectors are dashed to echo the product's dashed edges.
 * --------------------------------------------------------------------- */
.od-tree {
  margin-top: 1.6rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  /* Themed scrollbar so the horizontal track reads as part of the blue
   * canvas instead of the OS-default black thumb. */
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.45) rgba(255, 255, 255, 0.14);
}

.od-tree::-webkit-scrollbar {
  height: 8px;
}

.od-tree::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
}

.od-tree::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.45);
  border-radius: 999px;
}

.od-tree::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.65);
}

.od-tree ul {
  display: flex;
  justify-content: center;
  position: relative;
  padding: 34px 0 0;
  margin: 0;
  list-style: none;
}

.od-tree > ul {
  padding-top: 0;
  /* Size the whole tree to its content so node widths/gaps stay CONSTANT and
   * the canvas scrolls when narrower; min-width:100% lets it fill and centre
   * (justify-content) once the canvas is wide enough to hold it. */
  width: max-content;
  min-width: 100%;
}

.od-tree li {
  list-style: none;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Constant horizontal gap between nodes at every width - the tree scrolls
   * rather than tightening the spacing. flex-shrink:0 stops the nodes from
   * compressing when the canvas is narrower than the tree (they keep their
   * width and the canvas scrolls instead). */
  flex-shrink: 0;
  padding: 34px 12px 0;
}

/* vertical drop from a parent down to its children's bus */
.od-tree ul ul::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 0;
  height: 34px;
  border-left: 2px dashed rgba(206, 224, 247, 0.6);
}

/* horizontal bus halves + each child's own drop */
.od-tree li::before,
.od-tree li::after {
  content: "";
  position: absolute;
  top: 0;
  right: 50%;
  width: 50%;
  height: 34px;
  border-top: 2px dashed rgba(206, 224, 247, 0.6);
}

.od-tree li::after {
  right: auto;
  left: 50%;
  border-left: 2px dashed rgba(206, 224, 247, 0.6);
}

.od-tree li:only-child::before,
.od-tree li:only-child::after {
  display: none;
}

.od-tree li:only-child {
  padding-top: 34px;
}

.od-tree li:first-child::before,
.od-tree li:last-child::after {
  border: 0 none;
}

.od-tree li:last-child::before {
  border-right: 2px dashed rgba(206, 224, 247, 0.6);
  border-radius: 0 6px 0 0;
}

.od-tree li:first-child::after {
  border-radius: 6px 0 0 0;
}

/* subtle "alive" shimmer on all connectors */
.od-tree li::before,
.od-tree li::after,
.od-tree ul ul::before {
  animation: odDash 2.6s ease-in-out infinite;
}

@keyframes odDash {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.9; }
}

/* -----------------------------------------------------------------------
 * Delegation / reporting signal flow. A live pulse travels DOWN each
 * connector ("Delegating", orange) as the manager hands work to an AI
 * employee, then back UP ("Completed", green) as the employee reports the
 * result. Each edge carries its own irregular --od-delay so the edges fire
 * out of sync and the department reads as busy, functioning and concurrent
 * rather than a single lock-step animation. Echoes the home page's
 * delegate-down / report-up pulse and the real dashboard's edge status
 * pills. The flow sits in each node's connector zone (the top padding of
 * the <li>) above the dashed lines.
 * --------------------------------------------------------------------- */
.od-flow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 34px;
  pointer-events: none;
  z-index: 4;
}

.od-flow-dot {
  position: absolute;
  top: 2px;
  left: 50%;
  width: 9px;
  height: 9px;
  margin-left: -4.5px;
  border-radius: 50%;
  opacity: 0;
  background: #f59e0b;
  animation: odFlowDot 16s linear infinite;
  animation-delay: var(--od-delay, 0s);
}

.od-flow-tag {
  position: absolute;
  top: 1px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0;
  box-shadow: 0 3px 10px rgba(11, 31, 59, 0.3);
  animation-duration: 16s;
  animation-timing-function: ease;
  animation-iteration-count: infinite;
  animation-delay: var(--od-delay, 0s);
}

.od-flow-tag--deleg {
  background: #f59e0b;
  color: #3a2400;
  animation-name: odTagDeleg;
}

.od-flow-tag--done {
  background: #22a06b;
  color: #ecfff6;
  animation-name: odTagDone;
}

/* Down = delegate (orange), then up = report/completed (green). */
@keyframes odFlowDot {
  0%   { top: 2px;  opacity: 0; background: #f59e0b; box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
  5%   { opacity: 1; box-shadow: 0 0 11px 2px rgba(245, 158, 11, 0.7); }
  20%  { top: 28px; opacity: 1; background: #f59e0b; box-shadow: 0 0 11px 2px rgba(245, 158, 11, 0.7); }
  25%  { top: 28px; opacity: 0; background: #f59e0b; box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
  47%  { top: 28px; opacity: 0; background: #22a06b; box-shadow: 0 0 0 0 rgba(34, 160, 107, 0); }
  52%  { top: 28px; opacity: 1; background: #22a06b; box-shadow: 0 0 11px 2px rgba(34, 160, 107, 0.7); }
  68%  { top: 2px;  opacity: 1; background: #22a06b; box-shadow: 0 0 11px 2px rgba(34, 160, 107, 0.7); }
  74%  { top: 2px;  opacity: 0; background: #22a06b; box-shadow: 0 0 0 0 rgba(34, 160, 107, 0); }
  100% { top: 2px;  opacity: 0; background: #f59e0b; box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

@keyframes odTagDeleg {
  0%, 2%    { opacity: 0; transform: translateX(-50%) translateY(-3px) scale(0.9); }
  7%, 20%   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  26%, 100% { opacity: 0; transform: translateX(-50%) translateY(-3px) scale(0.9); }
}

@keyframes odTagDone {
  0%, 46%   { opacity: 0; transform: translateX(-50%) translateY(3px) scale(0.9); }
  53%, 68%  { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  74%, 100% { opacity: 0; transform: translateX(-50%) translateY(3px) scale(0.9); }
}

/* -----------------------------------------------------------------------
 * Reporting line (top tier only). A department has a single HOD (the Project
 * Manager); the mid-level Supervisors report up to it. Alongside the dashed
 * delegate-DOWN connector we draw a persistent solid-green report-UP channel,
 * offset a few px so both "lanes" read at once, with an arrowhead pointing up
 * toward the HOD. A slow green pulse rises along it to reinforce reporting.
 * Rendered via .od-report spans placed only in the four Supervisor <li>s.
 * --------------------------------------------------------------------- */
.od-report {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 34px;
  pointer-events: none;
  z-index: 3;
}

/* The green report lane, parallel to (5px left of) the dashed delegation drop. */
.od-report::before {
  content: "";
  position: absolute;
  left: 50%;
  margin-left: -6px;
  top: 7px;
  bottom: 0;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(to top, rgba(34, 160, 107, 0.25), #22a06b);
}

/* Arrowhead at the top of the lane, pointing up toward the HOD. */
.od-report::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  margin-left: -10px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 6px solid #22a06b;
}

/* A slow token rising up the report lane. */
.od-report-dot {
  position: absolute;
  left: 50%;
  margin-left: -8.5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #22a06b;
  box-shadow: 0 0 8px 1px rgba(34, 160, 107, 0.7);
  opacity: 0;
  animation: odReportRise 16s linear infinite;
  animation-delay: var(--od-delay, 0s);
}

@keyframes odReportRise {
  0%   { top: 28px; opacity: 0; }
  6%   { opacity: 1; }
  40%  { top: 4px;  opacity: 1; }
  46%  { top: 4px;  opacity: 0; }
  100% { top: 4px;  opacity: 0; }
}

/* ---- White product panels (picker / skills / files) ------------------ */
.od-panel {
  background: #fff;
  border: 1px solid #e6edf3;
  border-radius: 16px;
  padding: 1.25rem 1.35rem 1.4rem;
  box-shadow: 0 18px 44px rgba(15, 32, 60, 0.16);
  color: #1e293b;
  text-align: left;
}

.od-panel-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
}

.od-panel-title {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  margin: 0;
}

.od-step-chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  border: 1px solid rgba(167, 93, 236, 0.4);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
}

/* ---- "Add a department" picker --------------------------------------- */
.od-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.od-picker-card {
  position: relative;
  border: 1.5px solid #e6edf3;
  border-radius: 12px;
  padding: 0.9rem 0.95rem 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.od-picker-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(167, 93, 236, 0.14);
}

.od-picker-icon {
  font-size: 1.4rem;
  margin-bottom: 0.55rem;
}

.od-picker-name {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 0.3rem;
}

.od-picker-desc {
  font-size: 0.78rem;
  line-height: 1.45;
  color: #64748b;
  margin: 0;
}

.od-picker-radio {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #cbd5e1;
}

.od-picker-card.is-selected .od-picker-radio {
  border-color: var(--accent);
  background: var(--accent);
}

.od-picker-card.is-selected .od-picker-radio::after {
  content: "\2713";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}

.od-panel-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.15rem;
}

.od-btn-create {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 10px;
  padding: 0.55rem 1.3rem;
  box-shadow: 0 8px 18px rgba(167, 93, 236, 0.35);
}

/* ---- Skills panel ---------------------------------------------------- */
.od-skills-group + .od-skills-group {
  margin-top: 1rem;
}

.od-skills-cat {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin: 0 0 0.5rem;
}

.od-skill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-top: 1px solid #eef2f7;
  font-size: 0.86rem;
  color: #334155;
}

.od-toggle {
  flex: 0 0 auto;
  width: 34px;
  height: 19px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
}

.od-toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.2s ease;
}

.od-toggle.is-on {
  background: var(--primary);
}

.od-toggle.is-on::after {
  left: 17px;
}

/* ---- Files list ------------------------------------------------------ */
.od-file-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.62rem 0;
  border-top: 1px solid #eef2f7;
  font-size: 0.86rem;
}

.od-file-row:first-of-type {
  border-top: 0;
}

.od-file-ic {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--primary-dim);
  color: var(--primary);
}

.od-file-name {
  font-weight: 500;
  color: #1e293b;
}

.od-file-meta {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #94a3b8;
}

/* =====================================================================
 * How-it-works "product tour" rows — copy + native mockup, alternating.
 * Sits on the dark #steps ground; copy uses light-on-dark defaults.
 * ===================================================================== */
.hiw-tour {
  margin-top: 4rem;
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

.hiw-tour-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

.hiw-tour-row:nth-child(even) .hiw-tour-copy {
  order: 2;
}

.hiw-tour-num {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--tertiary);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
}

.hiw-tour-num::before {
  content: "";
  width: 34px;
  height: 1px;
  background: var(--border-warm);
}

.hiw-tour-title {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.7rem;
}

.hiw-tour-desc {
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0 0 1.1rem;
}

.hiw-tour-visual {
  min-width: 0;
}

/* Reused .bp-tool-pill chips (white, readable on the dark ground); left-align
 * them under the copy instead of the bento's centred default. */
.hiw-tour-copy .bp-chip-row {
  justify-content: flex-start;
}

/* ---- Responsive ------------------------------------------------------ */
/* Wide screens: the operating-model canvas otherwise sits inside the ~1440
 * content container, so the ~1600px constant-spacing tree would always scroll.
 * Break the canvas out toward the viewport edges (margin-based centering, not
 * transform, so AOS's inline transform can't fight it) so the whole department
 * fits and centres once the viewport is wide enough. The cards/gaps are NOT
 * resized here - they stay constant; only the canvas grows. */
@media (min-width: 1540px) {
  .od-office-canvas {
    width: min(1780px, 94vw);
    max-width: none;
    margin-left: calc((100% - min(1780px, 94vw)) / 2);
  }
}

@media (max-width: 860px) {
  .hiw-tour-row {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .hiw-tour-row:nth-child(even) .hiw-tour-copy {
    order: 0;
  }

  .od-picker-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  /* Vertical stack (arrangement A): the org chart linearises into full-width
   * cards grouped by supervisor. The Project Manager (HOD) and the four
   * Supervisors sit flush; each Supervisor's two AI employees indent ONE level
   * under a solid accent rail so every team reads as a unit - no runaway
   * depth-based indentation, no cramped cards. */
  .od-tree {
    overflow-x: visible;
  }

  .od-tree ul {
    flex-direction: column;
    align-items: stretch;
    padding: 0;
  }

  /* Undo the desktop max-content sizing so the stack fits the viewport width
   * and cards wrap their text instead of overflowing to the right. */
  .od-tree > ul {
    width: auto;
    min-width: 0;
  }

  /* The Project Manager's children (the Supervisors) sit flush - no indent. */
  .od-tree ul ul {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }

  /* Each Supervisor's team (its AI employees) indents one level with a solid
   * accent rail that groups the team beneath its Supervisor. */
  .od-tree ul ul ul {
    margin-left: 0.85rem;
    padding-left: 0.85rem;
    border-left: 3px solid rgba(69, 125, 191, 0.4);
  }

  .od-tree li {
    align-items: stretch;
    padding: 0.5rem 0 0;
  }

  /* Extra breathing room before each Supervisor group (except the first). */
  .od-tree > ul > li > ul > li {
    margin-top: 1.1rem;
  }

  .od-tree > ul > li > ul > li:first-child {
    margin-top: 0.6rem;
  }

  .od-tree li::before,
  .od-tree li::after,
  .od-tree ul ul::before {
    display: none;
  }

  /* No org-chart connectors on the linearised rail, so the traveling
   * signal / report lane have nothing to ride along; drop them. */
  .od-flow,
  .od-report {
    display: none;
  }

  /* Full-width, comfortably padded cards; drop the desktop min-height and the
   * 3-line clamp so the stacked cards size to their content. */
  .od-tree .od-agent-card {
    width: 100%;
    min-height: 0;
    padding: 0.85rem 1rem 0.9rem;
  }

  .od-tree .od-agent-desc {
    -webkit-line-clamp: none;
    overflow: visible;
  }
}

@media (max-width: 460px) {
  .od-picker-grid {
    grid-template-columns: 1fr;
  }
}

/* Respect reduced-motion: still the connector shimmer. */
@media (prefers-reduced-motion: reduce) {
  .od-tree li::before,
  .od-tree li::after,
  .od-tree ul ul::before {
    animation: none;
  }

  /* The delegation/reporting flow (.od-flow-dot / .od-flow-tag) is
   * deliberately NOT suppressed here: it is a core product selling point and
   * runs regardless of the OS "Reduce motion" setting, matching the home
   * page's SVG delegate-down / report-up pulse (SVG <animate> ignores
   * prefers-reduced-motion, so this keeps parity). Only the subtle connector
   * shimmer above is stilled. */
}

/* ---- Homepage hero: distilled delegation demo (.od-hero) --------------
 * A compact single-department (Finance) tree that replaces the old generic
 * "AI hub" graphic in the homepage hero's right column. It reuses the light
 * .od-office-canvas panel (reads as a floating product surface on the dark
 * hero) and the full .od-flow / .od-report delegate-down / report-up
 * animation. Only sizing is overridden here so 1 HOD + 2 supervisors +
 * 4 AI employees fit the hero column with NO horizontal scroll. Scoped to
 * .od-hero so /how-it-works/ is untouched. Placed after the wide-screen
 * breakout (min-width:1540px) rule so source order neutralises it here. */
/* Transparent panel: no light card, no border, no shadow, so the tree floats
 * directly on the dark hero and the particle field shows through (mirrors the
 * borderless bento #deleg-svg). */
.od-hero.od-office-canvas {
  width: 100%;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  padding: 0.5rem 0 0.6rem;
  background: none;
  border: none;
  box-shadow: none;
  overflow: visible;
}

/* Position the graph so it reads centred in the hero. Applied to .od-tree, not
 * .od-hero, because the hero GSAP intro owns .od-hero's transform.
 * - translateX: the content container caps at ~1480 while the dark hero band is
 *   full-bleed, so wide viewports leave growing empty space to the RIGHT of the
 *   graph. A viewport-responsive shift keeps the left/right gaps balanced across
 *   widths (16px at 1440, growing ~0.22/px beyond, capped). Balanced at 1440.
 * - translateY: the tall graph + the container's top padding otherwise push the
 *   graph low (near the bottom edge); lift it to sit vertically centred. */
.od-hero .od-tree {
  transform:
    translateX(clamp(16px, calc(16px + (100vw - 1440px) * 0.20), 260px))
    translateY(-112px);
}

/* Shrink cards + gaps so 4 leaves (4 x ~128px) fit the ~530px panel. */
.od-hero .od-tree ul {
  padding-top: 26px;
}
.od-hero .od-tree li {
  padding-left: 13px;
  padding-right: 13px;
}
.od-hero .od-tree .od-agent-card {
  width: 172px;
  min-height: 158px;
  padding: 0.95rem 0.9rem 1rem;
  box-shadow: 0 8px 20px rgba(4, 12, 28, 0.32);
}
/* Stack the avatar above the name so long single-word role names
 * ("Bookkeeping") get the card's full width and never clip. */
.od-hero .od-tree .od-agent-top {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
}
.od-hero .od-tree .od-agent-avatar {
  width: 44px;
  height: 44px;
  font-size: 1.18rem;
}
.od-hero .od-tree .od-agent-name {
  font-size: 1.06rem;
  margin-bottom: 0.34rem;
}
.od-hero .od-tree .od-role-badge {
  font-size: 0.58rem;
  padding: 0.14rem 0.4rem;
}
.od-hero .od-tree .od-status {
  font-size: 0.68rem;
}

/* AI-employee nodes become OUTLINED glass on the dark ground (the filled blue
 * manager/supervisor nodes stay as-is), mirroring the previous animation's
 * filled-supervisor / outlined-worker language. */
.od-hero .od-tree .od-agent-card:not(.is-manager) {
  background: rgba(17, 38, 71, 0.55);
  border: 1px solid rgba(161, 247, 254, 0.32);
  box-shadow: 0 6px 18px rgba(4, 12, 28, 0.35);
  color: #e8f1fb;
}
.od-hero .od-tree .od-agent-card:not(.is-manager) .od-agent-name {
  color: #f2f7fd;
}
.od-hero .od-tree .od-agent-card:not(.is-manager) .od-agent-avatar {
  background: rgba(161, 247, 254, 0.14);
  color: #a1f7fe;
}
.od-hero .od-tree .od-agent-card:not(.is-manager) .od-status {
  color: #cfe0f7;
}

/* HOD + Supervisor nodes: also transparent, but a BRIGHTER blue-tinted glass
 * (vs the employees' darker glass) so the manager tier still reads as primary. */
.od-hero .od-tree .od-agent-card.is-manager {
  background: rgba(63, 131, 217, 0.22);
  border: 1px solid rgba(140, 186, 240, 0.55);
  box-shadow: 0 8px 22px rgba(4, 12, 28, 0.35);
}
.od-hero .od-tree .od-agent-card.is-manager .od-agent-avatar {
  background: rgba(8, 22, 46, 0.5);
  color: #dbeafe;
}
.od-hero .od-tree .od-agent-card.is-manager .od-status {
  color: #e8f1fb;
}

/* Light dashed connectors for the dark (now transparent) ground. */
.od-hero .od-tree ul ul::before,
.od-hero .od-tree li::before,
.od-hero .od-tree li::after {
  border-color: rgba(200, 224, 252, 0.34);
}

/* Taller graph: grow the vertical gap between tiers from 34px to 54px so the
 * tree reads bigger. The connector zone, the padding that opens it, AND the
 * animated .od-flow / .od-report layers that ride it must all grow together,
 * or the travelling dots stop short of the new gap. Scoped keyframes below
 * re-span the dot travel to the taller zone. */
.od-hero .od-tree ul {
  padding-top: 54px;
}
.od-hero .od-tree li {
  padding-top: 54px;
}
.od-hero .od-tree li:only-child {
  padding-top: 54px;
}
.od-hero .od-tree ul ul::before,
.od-hero .od-tree li::before,
.od-hero .od-tree li::after {
  height: 54px;
}
.od-hero .od-flow,
.od-hero .od-report {
  height: 54px;
}
.od-hero .od-flow-dot {
  animation-name: odFlowDotHero;
}
.od-hero .od-report-dot {
  animation-name: odReportRiseHero;
}

@keyframes odFlowDotHero {
  0%   { top: 2px;  opacity: 0; background: #f59e0b; box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
  5%   { opacity: 1; box-shadow: 0 0 11px 2px rgba(245, 158, 11, 0.7); }
  20%  { top: 46px; opacity: 1; background: #f59e0b; box-shadow: 0 0 11px 2px rgba(245, 158, 11, 0.7); }
  25%  { top: 46px; opacity: 0; background: #f59e0b; box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
  47%  { top: 46px; opacity: 0; background: #22a06b; box-shadow: 0 0 0 0 rgba(34, 160, 107, 0); }
  52%  { top: 46px; opacity: 1; background: #22a06b; box-shadow: 0 0 11px 2px rgba(34, 160, 107, 0.7); }
  68%  { top: 2px;  opacity: 1; background: #22a06b; box-shadow: 0 0 11px 2px rgba(34, 160, 107, 0.7); }
  74%  { top: 2px;  opacity: 0; background: #22a06b; box-shadow: 0 0 0 0 rgba(34, 160, 107, 0); }
  100% { top: 2px;  opacity: 0; background: #f59e0b; box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

@keyframes odReportRiseHero {
  0%   { top: 46px; opacity: 0; }
  6%   { opacity: 1; }
  40%  { top: 4px;  opacity: 1; }
  46%  { top: 4px;  opacity: 0; }
  100% { top: 4px;  opacity: 0; }
}

/* On mobile the hero stacks to one column and the tree linearises (the base
 * max-width:760px block handles the tree itself); keep the panel edge-to-edge
 * and reset the desktop max-width so it never forces a scroll. */
@media (max-width: 760px) {
  .od-hero.od-office-canvas {
    max-width: none;
    padding: 1.3rem 1.1rem 1.5rem;
  }
  .od-hero .od-tree .od-agent-card {
    width: 100%;
    min-height: 0;
  }
  /* Full-width mobile cards read better with the avatar beside the name. */
  .od-hero .od-tree .od-agent-top {
    flex-direction: row;
    align-items: center;
  }
  /* Mobile linearises and hides the connectors, so the desktop 54px tier gap
   * is just wasted vertical space here - reset it to the compact stack spacing. */
  .od-hero .od-tree ul,
  .od-hero .od-tree li,
  .od-hero .od-tree li:only-child {
    padding-top: 0;
  }
  /* The desktop rightward nudge would offset the full-width stack - reset it. */
  .od-hero .od-tree {
    transform: none;
  }
}

/* =====================================================================
 * Homepage "The AI Office" teaser (front-page.php #ai-office-teaser)
 * -------------------------------------------------------------------
 * Entices the visitor to the full interactive department switcher on
 * /ai-office/ WITHOUT rendering a second live delegation tree on the home
 * page. Left: copy + CTA. Right: a framed, dimmed STATIC glimpse of the
 * switcher (light canvas + tabs + a faded node silhouette) under a play
 * scrim. Deep-navy band so it contrasts the light bento above; the
 * spotlight gradient differentiates it from the near-black #features-matrix
 * ("Who it's for") that follows, so the dark->dark seam doesn't read flat.
 * ===================================================================== */
#ai-office-teaser {
  background:
    radial-gradient(120% 90% at 80% 16%, rgba(69, 125, 191, 0.20) 0%, transparent 55%),
    linear-gradient(155deg, #0e1728 0%, #0a1120 62%, #0b1322 100%) !important;
  border: 1px solid rgba(69, 125, 191, 0.14);
  padding: 5.5rem 0 !important;
}

.od-teaser-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: 3rem;
}

.od-teaser-copy .hero-badge { margin-bottom: 1.4rem; }
.od-teaser-copy .aig-section-title { margin-bottom: 1.3rem; }
.od-teaser-copy .section-muted-lead { margin-bottom: 2rem; max-width: 520px; }

.od-teaser-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.od-teaser-cta i { font-size: 0.82em; }

/* ---- Framed static glimpse ---- */
.od-teaser-frame {
  position: relative;
  display: block;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(148, 178, 214, 0.22);
  box-shadow: 0 30px 60px rgba(3, 8, 18, 0.55);
  text-decoration: none;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s ease;
}
.od-teaser-frame:hover,
.od-teaser-frame:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 38px 72px rgba(3, 8, 18, 0.62);
}

/* Light slate canvas, echoing .od-office-canvas */
.od-teaser-canvas {
  padding: 1.4rem 1.5rem 2.6rem;
  background:
    radial-gradient(rgba(69, 125, 191, 0.1) 1px, transparent 1px) 0 0 / 26px 26px,
    linear-gradient(155deg, #eef4fc 0%, #dbe7f6 100%);
}

.od-teaser-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.6rem;
}
.od-teaser-tabs .filter-btn {
  font-size: 12.5px;
  padding: 6px 13px;
  cursor: default;
}
.od-teaser-tabs .filter-btn i { margin-right: 0.35rem; opacity: 0.85; }
.od-teaser-tabs .filter-btn.active {
  background: var(--secondary);
  color: #fff;
  box-shadow: 0 6px 16px rgba(20, 67, 132, 0.2);
}

/* Faded node silhouette: the "there's a live delegation tree in here" cue */
.od-teaser-mock {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding-top: 0.4rem;
}
.od-teaser-mock::before {         /* dashed trunk from HOD down to the leads */
  content: "";
  position: absolute;
  top: 3rem;
  left: 50%;
  width: 1px;
  height: 1.4rem;
  background: repeating-linear-gradient(to bottom, rgba(20, 67, 132, 0.35) 0 4px, transparent 4px 8px);
}
.od-teaser-row {
  display: flex;
  gap: 0.9rem;
  width: 100%;
  justify-content: center;
}
.od-teaser-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  flex: 1 1 0;
  max-width: 150px;
  padding: 0.8rem 0.6rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #d7e3f2;
  box-shadow: 0 8px 18px rgba(20, 67, 132, 0.08);
  text-align: center;
}
.od-teaser-node--hod {
  background: linear-gradient(160deg, var(--primary), var(--secondary));
  border-color: transparent;
}
.od-teaser-avatar {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(69, 125, 191, 0.12);
  color: var(--secondary);
  font-size: 13px;
}
.od-teaser-node--hod .od-teaser-avatar {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}
.od-teaser-node-name {
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 600;
  color: #1f2d43;
  line-height: 1.2;
}
.od-teaser-node--hod .od-teaser-node-name { color: #fff; }
.od-teaser-node-badge {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
  padding: 1px 7px;
  border-radius: 20px;
}

/* Scrim + play affordance: dims the lower canvas and sells "it animates" */
.od-teaser-scrim {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.8rem;
  padding-bottom: 1.7rem;
  background: linear-gradient(to bottom, rgba(13, 21, 38, 0) 32%, rgba(11, 18, 32, 0.55) 74%, rgba(10, 17, 30, 0.82) 100%);
}
.od-teaser-play {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--secondary);
  font-size: 20px;
  padding-left: 3px;                /* optically centre the play glyph */
  box-shadow: 0 10px 30px rgba(3, 8, 18, 0.4);
  transition: transform 0.3s ease;
}
.od-teaser-frame:hover .od-teaser-play,
.od-teaser-frame:focus-visible .od-teaser-play { transform: scale(1.08); }
.od-teaser-watch {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: #eaf1fb;
  letter-spacing: 0.01em;
}

/* Responsive: stack the two columns under ~900px */
@media (max-width: 900px) {
  .od-teaser-grid {
    grid-template-columns: 1fr;
    gap: 2.2rem;
  }
  .od-teaser-copy .section-muted-lead { max-width: none; }
}
@media (max-width: 480px) {
  .od-teaser-row { gap: 0.5rem; }
  .od-teaser-node { padding: 0.6rem 0.4rem; }
  .od-teaser-node-name { font-size: 11px; }
  .od-teaser-tabs .filter-btn { font-size: 11.5px; padding: 5px 10px; }
}
