/* Desktop Constellation view. Only shown when body has .mode-web (wide screens, see dashboard.js).
   Same light palette as the card view: cream ground, white surfaces, brand gold. */
#web, .w-palback {
  --w-bg: #faf8f5;
  --w-card: #ffffff;
  --w-ink: #1a1a1a;
  --w-muted: #6b6b6b;
  --w-line: #e7e3dc;
  --w-gold: #c1ab8a;
  --w-gold-deep: #a48b65;
  --w-gold-soft: #d5c2a4;
  --w-gold-text: #7f6946; /* gold dark enough for small text on cream (4.7:1) */
  --w-ui: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --w-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--w-ink); font: 400 14px/1.5 var(--w-ui);
}
#web { display: none; }
/* Wide screens: the Constellation covers the whole window, so its background never stops at an edge. The page's
   own clean header (logo + "Tools Dashboard") and footer line sit on top of it; constellation.js lays the tools
   out in the space between them. Header and footer let clicks through except on their own controls. */
body.mode-web { height: 100vh; overflow: hidden; padding: 3.5vh 0 14px; }
body.mode-web #web { display: block; position: fixed; inset: 0; }
body.mode-web > header, body.mode-web > footer { position: relative; z-index: 2; pointer-events: none; }
body.mode-web > footer button { pointer-events: auto; }
body.mode-web > header { margin-bottom: 6px; }
body.mode-web > header .logo { width: 220px; }
body.mode-web > header .eyebrow { margin-top: 14px; }
body.mode-web > footer { margin-top: auto; }
body.mode-web > main { display: none; }

#web button { font: inherit; color: inherit; }
#web :focus-visible { outline: 2px solid var(--w-gold-deep); outline-offset: 3px; }

/* stage: the whole window; the dot field fades out towards the edges (in constellation.js) */
#web .w-stage { position: absolute; inset: 0; overflow: hidden; }
#web .w-view { position: absolute; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none; }
#web .w-fx { position: absolute; inset: 0; display: block; }
#web .w-layer { position: absolute; inset: 0; pointer-events: none; }
#web .w-layer > * { pointer-events: auto; }
#web .w-layer > .w-fxlayer { position: absolute; inset: 0; pointer-events: none; }

/* motion that runs off the main thread: the drift wrapper inside each tool, cable pulses, the centre ripple */
#web .w-float { display: flex; flex-direction: column; align-items: center; gap: inherit; width: 100%; }
#web .w-pulse {
  position: absolute; left: 0; top: 0; width: 3px; height: 3px; border-radius: 50%;
  background: rgba(164, 139, 101, 0.7); box-shadow: 0 0 0 2.5px rgba(193, 171, 138, 0.2);
  offset-rotate: 0deg; will-change: offset-distance;
}
#web .w-pulse.lit { width: 4px; height: 4px; background: rgba(127, 105, 70, 0.85); box-shadow: 0 0 0 3.5px rgba(193, 171, 138, 0.3); }
#web .w-ring { position: absolute; left: 0; top: 0; border: 1px solid rgba(164, 139, 101, 0.28); border-radius: 50%; will-change: transform, opacity; }

/* tool nodes: each wears its own favicon, like the cards */
#web .w-node {
  position: absolute; left: 0; top: 0; width: 172px; text-decoration: none; color: var(--w-ink);
  display: flex; flex-direction: column; align-items: center; gap: 9px; cursor: grab;
  font: 500 15px/1.25 var(--w-ui); transition: opacity 0.25s; will-change: transform; -webkit-user-drag: none;
}
#web .w-node:focus-visible { outline: none; }
#web .w-ico {
  width: 70px; height: 70px; border-radius: 18px; display: block; object-fit: cover; flex: none;
  box-shadow: 0 8px 20px rgba(26, 26, 26, 0.20); border: 1px solid rgba(26, 26, 26, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease; -webkit-user-drag: none;
}
#web .w-node .w-lbl { text-align: center; text-wrap: balance; max-width: 166px; text-shadow: 0 0 6px var(--w-bg), 0 0 3px var(--w-bg); }
#web .w-node.featured .w-lbl { font-weight: 600; }
#web .w-node:hover .w-ico, #web .w-node:focus-visible .w-ico, #web .w-node.on .w-ico {
  transform: translateY(-3px); box-shadow: 0 0 0 2px var(--w-gold), 0 14px 30px rgba(164, 139, 101, 0.35);
}
#web .w-node.on .w-lbl { color: var(--w-gold-text); font-weight: 600; }
#web .w-dim { opacity: 0.22; }
#web .w-sub { cursor: pointer; font-size: 13px; gap: 7px; }
#web .w-sub .w-ico { width: 50px; height: 50px; border-radius: 13px; }
#web .w-sub .w-lbl { color: var(--w-muted); }
#web .w-sub:hover .w-lbl { color: var(--w-ink); }

/* Events: a small node whose first events peek out from behind its icon. Clicking it floats the events out as cards
   (constellation.js, EV holds the card's width and icon offsets). While they are out, every other tool dims. */
#web .w-menu { cursor: pointer; }
#web .w-stack { position: relative; display: block; flex: none; isolation: isolate; }
#web .w-peek {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%; border-radius: 18px; object-fit: cover; z-index: -1;
  box-shadow: 0 6px 14px rgba(26, 26, 26, 0.16); border: 1px solid rgba(26, 26, 26, 0.06);
  transition: transform 0.3s cubic-bezier(.2, .9, .3, 1.2), opacity 0.2s; -webkit-user-drag: none;
}
#web .w-peek0 { transform: translate(-17px, -5px) rotate(-14deg) scale(0.86); }
#web .w-peek1 { transform: translate(17px, -5px) rotate(14deg) scale(0.86); }
#web .w-menu:hover .w-peek0 { transform: translate(-24px, -8px) rotate(-19deg) scale(0.88); }
#web .w-menu:hover .w-peek1 { transform: translate(24px, -8px) rotate(19deg) scale(0.88); }
#web .w-menu.on .w-peek { transform: scale(0.5); opacity: 0; }
#web .w-count { font: 500 11px var(--w-mono); color: var(--w-gold-text); letter-spacing: 0.4px; margin-top: -5px; text-shadow: 0 0 6px var(--w-bg), 0 0 3px var(--w-bg); }
#web.w-evopen .w-node:not(.w-menu) { opacity: 0.25; }
#web .w-evmenu { position: absolute; inset: 0; z-index: 20; pointer-events: none; visibility: hidden; }
#web .w-evmenu.open { visibility: visible; }
#web .w-ev { position: absolute; left: 0; top: 0; width: 184px; will-change: transform; }
#web .w-evmenu.open .w-ev { pointer-events: auto; }
#web .w-evcard {
  display: flex; flex-direction: column; align-items: center; text-align: center; padding: 14px 12px 12px;
  background: var(--w-card); border: 1px solid var(--w-line); border-radius: 18px;
  box-shadow: 0 0 0 4px rgba(250, 248, 245, 0.7), 0 22px 46px rgba(26, 26, 26, 0.16);
}
#web .w-evico { display: block; border-radius: 16px; }
#web .w-evcard .w-ico { width: 64px; height: 64px; border-radius: 16px; }
#web .w-evico:hover .w-ico { transform: translateY(-3px); box-shadow: 0 0 0 2px var(--w-gold), 0 14px 30px rgba(164, 139, 101, 0.35); }
#web .w-evname { margin-top: 10px; font-size: 14.5px; font-weight: 600; line-height: 1.25; text-wrap: balance; }
#web .w-evwhen { margin-top: 3px; font: 400 11px var(--w-mono); color: var(--w-gold-text); letter-spacing: 0.3px; }
#web .w-ev.past .w-evwhen { color: var(--w-muted); }
#web .w-evacts { display: flex; gap: 6px; margin-top: 12px; width: 100%; }
#web .w-pill {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 7px 8px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; text-decoration: none; white-space: nowrap;
  background: var(--w-card); color: var(--w-ink); border: 1px solid var(--w-line); transition: border-color 0.15s, background 0.15s;
}
#web .w-pill:hover { border-color: var(--w-gold); }
#web .w-pill.dark { background: var(--w-gold); border-color: var(--w-gold); }
#web .w-pill.dark:hover { background: var(--w-gold-soft); }
#web .w-pill svg { width: 12px; height: 12px; flex: none; }
#web.w-compact .w-peek { border-radius: 15px; }

/* the big three: larger versions of the tool nodes. The website sits in the centre, Agent Hub and Business Console
   either side. Widths and icon sizes must match KIND in constellation.js. */
#web .w-big { width: 250px; gap: 8px; z-index: 5; }
#web .w-big .w-ico {
  width: 108px; height: 108px; border-radius: 28px;
  box-shadow: 0 0 0 3px #ffffff, 0 0 0 5px var(--w-gold-soft), 0 16px 34px rgba(26, 26, 26, 0.22);
}
#web .w-big:hover .w-ico, #web .w-big:focus-visible .w-ico, #web .w-big.on .w-ico {
  box-shadow: 0 0 0 3px #ffffff, 0 0 0 6px var(--w-gold), 0 22px 44px rgba(164, 139, 101, 0.4);
}
#web .w-big .w-lbl { font-size: 21px; font-weight: 700; max-width: 244px; margin-top: 4px; }
#web .w-short, #web .w-host, #web .w-kicker, #web .w-lock { text-shadow: 0 0 6px var(--w-bg), 0 0 3px var(--w-bg); }
#web .w-short { font-size: 13.5px; line-height: 1.4; color: var(--w-muted); text-align: center; max-width: 230px; }
#web .w-lock { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--w-gold-text); }
#web .w-primary { width: 300px; gap: 6px; z-index: 6; }
#web .w-primary .w-ico {
  width: 136px; height: 136px; border-radius: 34px;
  box-shadow: 0 0 0 4px #ffffff, 0 0 0 7px var(--w-gold), 0 22px 50px rgba(164, 139, 101, 0.38);
}
#web .w-primary .w-lbl { font-size: 30px; margin-top: 2px; }
#web .w-kicker { font: 500 11px var(--w-mono); color: var(--w-gold-text); letter-spacing: 0.6px; text-transform: uppercase; margin-top: 10px; }
#web .w-host { font: 400 13.5px var(--w-mono); color: var(--w-muted); }
#web .w-alsologo { width: 20px; height: 20px; border-radius: 5px; margin-right: 8px; }

/* Short screens: smaller tools so everything fits between header and footer (sizes match KIND_COMPACT). */
#web.w-compact .w-node { width: 156px; font-size: 14px; }
#web.w-compact .w-ico { width: 58px; height: 58px; border-radius: 15px; }
#web.w-compact .w-node .w-lbl { max-width: 150px; }
#web.w-compact .w-sub { font-size: 12px; }
#web.w-compact .w-sub .w-ico { width: 42px; height: 42px; border-radius: 11px; }
#web.w-compact .w-big { width: 230px; }
#web.w-compact .w-big .w-ico { width: 90px; height: 90px; border-radius: 24px; }
#web.w-compact .w-big .w-lbl { font-size: 19px; max-width: 224px; }
#web.w-compact .w-short { font-size: 12.5px; max-width: 210px; }
#web.w-compact .w-primary { width: 280px; }
#web.w-compact .w-primary .w-ico { width: 116px; height: 116px; border-radius: 30px; }
#web.w-compact .w-primary .w-lbl { font-size: 27px; }
#web.w-compact .w-host { font-size: 12.5px; }

/* drawer */
#web .w-drawer {
  position: absolute; z-index: 80; top: 14px; right: 14px; bottom: 14px; width: 352px;
  background: var(--w-card); border: 1px solid var(--w-line); border-radius: 18px;
  box-shadow: 0 30px 70px rgba(26, 26, 26, 0.14); padding: 24px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 16px; visibility: hidden; transform: translateX(calc(100% + 24px));
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.35s;
}
#web .w-drawer.open { transform: none; visibility: visible; transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
#web .w-x { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--w-line); background: var(--w-card); cursor: pointer; color: var(--w-muted); font-size: 18px; line-height: 1; }
#web .w-x:hover { color: var(--w-ink); border-color: var(--w-gold); }
#web .w-dhead { display: flex; gap: 14px; align-items: center; padding-right: 36px; }
#web .w-dhead .w-ico { width: 60px; height: 60px; border-radius: 16px; }
#web .w-dstage { font: 500 11px var(--w-mono); color: var(--w-gold-text); }
#web .w-drawer h2 { margin: 2px 0 0; font-size: 21px; font-weight: 700; line-height: 1.2; text-wrap: balance; }
#web .w-dhost { font: 400 12px var(--w-mono); color: var(--w-muted); word-break: break-all; }
#web .w-drawer p.w-blurb { margin: 0; line-height: 1.6; color: #3a3a3a; }
#web .w-dnote { display: flex; gap: 8px; margin: 0; font-size: 12.5px; color: var(--w-muted); padding: 10px 12px; border-radius: 10px; background: var(--w-bg); border: 1px solid var(--w-line); }
#web .w-dnote svg { flex: none; margin-top: 2px; color: var(--w-gold-deep); }
#web .w-dacts { display: flex; flex-direction: column; gap: 8px; }
#web .w-open {
  display: flex; justify-content: center; padding: 12px 14px; border-radius: 11px; text-decoration: none; font-weight: 600; font-size: 14px;
  background: var(--w-gold); color: var(--w-ink); border: 1px solid var(--w-gold);
}
#web .w-open:hover { background: var(--w-gold-soft); }
#web .w-open.alt { background: var(--w-card); border-color: var(--w-line); align-items: center; }
#web .w-open.alt:hover { border-color: var(--w-gold); }

/* command palette */
.w-palback { position: fixed; inset: 0; z-index: 200; background: rgba(250, 248, 245, 0.72); display: grid; place-items: start center; padding: 12vh 16px 16px; }
.w-palback[hidden] { display: none; }
.w-pal { width: min(560px, 100%); background: var(--w-card); border: 1px solid var(--w-line); border-radius: 16px; overflow: hidden; box-shadow: 0 40px 90px rgba(26, 26, 26, 0.2); }
.w-pal input { width: 100%; border: 0; border-bottom: 1px solid var(--w-line); background: none; color: var(--w-ink); font: 400 16px var(--w-ui); padding: 16px 18px; outline: none; }
.w-pal input::placeholder { color: var(--w-muted); }
.w-pal ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow-y: auto; }
.w-pal li { display: grid; grid-template-columns: auto 1fr auto; gap: 0 12px; align-items: center; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.w-pal li .w-ico { display: block; object-fit: cover; width: 34px; height: 34px; border-radius: 9px; grid-row: 1 / span 2; }
.w-pal li b { font-weight: 600; }
.w-pal li small { color: var(--w-muted); font: 400 11px var(--w-mono); }
.w-pal li .st { grid-row: 1 / span 2; grid-column: 3; font: 400 11px var(--w-mono); color: var(--w-gold-text); }
.w-pal li[aria-selected="true"] { background: var(--w-bg); box-shadow: inset 0 0 0 1px var(--w-gold-soft); }
.w-pal .w-empty { padding: 18px; color: var(--w-muted); display: block; }
.w-palfoot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--w-line); font: 400 11px var(--w-mono); color: var(--w-muted); }

/* switch back to the constellation from the card view (wide screens only) */
.to-web {
  display: none; margin: 14px auto 0; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); color: var(--gold-deep); cursor: pointer;
  font: 600 12px -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; letter-spacing: 0.4px;
}
.to-web:hover { border-color: var(--gold); }
body.can-web .to-web { display: inline-flex; }
