/* NEXUS home layouts: the styles for nx-home.js (same folder). Loaded in the head of index.html, after
   nx-ui.css and before the page's own styles, so a layout's ground paints with the first paint.
   Bump ?v= on every edit.

   One block per layout, every rule scoped under .nx-home--<id> (the class NxHome puts on the box it hands
   to draw). A box is either the home box, filling #nx-home-host, or a miniature: the same box at a design
   size, shown at a CSS scale. Adding a layout = adding its block here; nothing in index.html changes.
   The home shell (#mindmap, #mindmap-body, the top bar, the corners) keeps its rules in index.html. */

/* ═══════════════════ THE BOX ═══════════════════ */
.nx-home { position:absolute; inset:0; overflow:hidden; }
/* A miniature: NxHome sets its design size and scale inline, and makes it inert. Frozen: no motion, no pointer.
   It always sits in its own frame (.nx-home-mini), whatever the layout's own box rule says. */
.nx-home[data-preview] { position:absolute; inset:auto; left:0; top:0; transform-origin:0 0; pointer-events:none; }
.nx-home[data-preview], .nx-home[data-preview] *, .nx-home[data-preview] *::before, .nx-home[data-preview] *::after { transition:none !important; animation:none !important; }

/* ═══════════════════ MIND MAP ═══════════════════ */
/* The ground (moved from #mindmap-body) and the stage. */
.nx-home--mindmap {
  display:flex; align-items:center; justify-content:center;
  z-index:1;
  background:
    radial-gradient(ellipse 45% 40% at 50% 50%, rgba(var(--accent-rgb),0.05), transparent 75%),
    radial-gradient(ellipse 65% 55% at 50% 50%, var(--grad-mindmap-0) 0%, var(--grad-mindmap-veil) 55%, transparent 85%),
    var(--grad-mindmap-2);
  --nx-titlebar: var(--grad-mindmap-2);
}
.nx-home--mindmap .mm-grid-bg {
  position:absolute; inset:0; pointer-events:none;
  background-image:
    linear-gradient(to right, rgba(var(--accent-rgb),0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(var(--accent-rgb),0.04) 1px, transparent 1px);
  background-size:80px 80px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 15%, rgba(0,0,0,0.4) 55%, transparent 95%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 15%, rgba(0,0,0,0.4) 55%, transparent 95%);
}
.nx-home--mindmap .mm-stage {
  position:relative; width:min(1180px, 96%); height:min(820px, 92%);
}
.nx-home--mindmap .mm-lines {
  position:absolute; inset:0; width:100%; height:100%; pointer-events:none;
}
/* Lines: a rest line (module color fading out before the hub) and a hot line
   (module color into the hub's teal) per module; hovering a node crossfades
   them and runs the pulse dot. Gradients and ends are set in drawMindmap (nx-home.js). */
.nx-home--mindmap .mm-line { fill:none; stroke-linecap:round; transition:opacity .25s ease; }
.nx-home--mindmap .mm-line-rest { stroke-width:1.75; }
.nx-home--mindmap .mm-line-hot { stroke-width:2.25; opacity:0; }
.nx-home--mindmap .mm-line-dot { opacity:0; }
.nx-home--mindmap .mm-link.is-hot .mm-line-rest { opacity:0; }
.nx-home--mindmap .mm-link.is-hot .mm-line-hot { opacity:1; }

/* Hub: the logo is the hub; every module line points at its center and ends short of its rings */
.nx-home--mindmap .mm-hub {
  position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
  width:300px; height:300px; display:flex; align-items:center; justify-content:center;
  pointer-events:none;
}
/* Two-tone glow: cyan up-left, emerald down-right of the logo center.
   Sits in the stage before the lines layer, so it's behind lines and logo. */
.nx-home--mindmap .mm-hub-glow {
  position:absolute; left:50%; top:50%; width:760px; height:760px; margin:-380px 0 0 -380px;
  background:
    radial-gradient(circle 260px at calc(50% - 50px) calc(50% - 45px),
    rgba(34,211,238,0.1) 0%, rgba(34,211,238,0.082) 18%, rgba(34,211,238,0.055) 38%,
    rgba(34,211,238,0.028) 58%, rgba(34,211,238,0.009) 78%, rgba(34,211,238,0) 100%),
    radial-gradient(circle 260px at calc(50% + 55px) calc(50% + 50px),
    rgba(16,185,129,0.09) 0%, rgba(16,185,129,0.0738) 18%, rgba(16,185,129,0.0495) 38%,
    rgba(16,185,129,0.0252) 58%, rgba(16,185,129,0.0081) 78%, rgba(16,185,129,0) 100%);
  pointer-events:none;
}
.nx-home--mindmap .mm-hub-logo {
  position:relative; display:block; width:160px; height:160px;
}
/* Role / tier pill, bottom-right corner of the mind map area */

/* Nodes */
.nx-home--mindmap .mm-node {
  position:absolute; left:0; top:0; width:80px; height:80px;
  transform:translate(-50%,-50%); cursor:pointer; --c:var(--accent);
  background:transparent; border:0; padding:0; font:inherit; color:inherit; outline:none;
}
/* Flat fill, no glow. The ring is SVG (.mm-node-ring, built in drawMindmap (nx-home.js)):
   2.5px in the module's sweep, about half the icon's 4.2px line weight. */
.nx-home--mindmap .mm-node-circle {
  position:relative; width:80px; height:80px; border-radius:50%;
  background:#0E1118;
  display:flex; align-items:center; justify-content:center;
}
.nx-home--mindmap .mm-node-ring {
  position:absolute; left:-16px; top:-16px; width:112px; height:112px;
  overflow:visible; pointer-events:none;
}
.nx-home--mindmap .mm-node-ring circle { fill:none; }
.nx-home--mindmap .mm-ring { stroke-width:2.5; transition:stroke-width .25s ease, opacity .25s ease; }
.nx-home--mindmap .mm-ring-hot { opacity:0; }
.nx-home--mindmap .mm-ring-orbit {
  stroke:var(--c); stroke-opacity:.4; stroke-width:1.25; opacity:0; transition:opacity .25s ease;
}
.nx-home--mindmap .mm-node-label {
  position:absolute; left:50%; transform:translateX(-50%); top:calc(100% + 12px);
  padding-left:2.4px; /* balances the trailing letter-spacing, so the label centers */
  font-family:'Plus Jakarta Sans',sans-serif; font-weight:700; font-size:13px; line-height:16px;
  letter-spacing:2.4px; text-transform:uppercase; color:#BAC2CE;
  white-space:nowrap; transition:color .25s ease;
}
/* One-line description, faded in under the label on hover */
.nx-home--mindmap .mm-node-desc {
  position:absolute; left:50%; transform:translateX(-50%); top:calc(100% + 33px);
  font-family:'Plus Jakarta Sans',sans-serif; font-weight:500; font-size:11.5px; line-height:14px;
  letter-spacing:.3px; color:#BAC2CE; white-space:nowrap;
  opacity:0; pointer-events:none; transition:opacity .25s ease;
}
.nx-home--mindmap .mm-node:hover .mm-ring,
.nx-home--mindmap .mm-node:focus-visible .mm-ring { stroke-width:3; }
.nx-home--mindmap .mm-node:hover .mm-ring-hot,
.nx-home--mindmap .mm-node:focus-visible .mm-ring-hot,
.nx-home--mindmap .mm-node:hover .mm-ring-orbit,
.nx-home--mindmap .mm-node:focus-visible .mm-ring-orbit,
.nx-home--mindmap .mm-node:hover .mm-node-desc,
.nx-home--mindmap .mm-node:focus-visible .mm-node-desc { opacity:1; }
.nx-home--mindmap .mm-node:hover .mm-node-label,
.nx-home--mindmap .mm-node:focus-visible .mm-node-label { color:#FFFFFF; }

/* ─── Light mode: Mind Map Stage ─── */
body.light-mode .nx-home--mindmap {
  background:
    radial-gradient(ellipse 45% 40% at 50% 50%, rgba(13,148,136,0.06), transparent 75%),
    radial-gradient(ellipse 65% 55% at 50% 50%, #FAF7F0 0%, #F5F2EB 55%, #E8E2D2 100%),
    #E8E2D2 !important;
  --nx-titlebar: #E8E2D2;
}
body.light-mode .nx-home--mindmap .mm-grid-bg {
  background-image:
    linear-gradient(to right, rgba(15,22,38,0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15,22,38,0.06) 1px, transparent 1px);
}
body.light-mode .nx-home--mindmap .mm-hub-glow {
  background:
    radial-gradient(circle 260px at calc(50% - 50px) calc(50% - 45px),
    rgba(13,148,136,0.05) 0%, rgba(13,148,136,0.041) 18%, rgba(13,148,136,0.0275) 38%,
    rgba(13,148,136,0.014) 58%, rgba(13,148,136,0.0045) 78%, rgba(13,148,136,0) 100%),
    radial-gradient(circle 260px at calc(50% + 55px) calc(50% + 50px),
    rgba(13,148,136,0.045) 0%, rgba(13,148,136,0.0369) 18%, rgba(13,148,136,0.0248) 38%,
    rgba(13,148,136,0.0126) 58%, rgba(13,148,136,0.004) 78%, rgba(13,148,136,0) 100%);
}
body.light-mode .nx-home--mindmap .mm-node-circle {
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,1), rgba(255,255,255,0.85) 35%, rgba(255,255,255,0.65) 70%),
    radial-gradient(circle at 50% 95%, color-mix(in srgb, var(--c) 14%, transparent) 0%, transparent 55%),
    #FFFFFF;
}
body.light-mode .nx-home--mindmap .mm-node-label,
body.light-mode .nx-home--mindmap .mm-node-desc { color:#5C6677; }
body.light-mode .nx-home--mindmap .mm-node:hover .mm-node-label,
body.light-mode .nx-home--mindmap .mm-node:focus-visible .mm-node-label { color:#0F1626; }
/* Node colors: --c is set per node to NxIcons.cssVar(module), and the ring
   gradients use NxIcons.sweepStops(); both follow body.light-mode live
   (nx-icons.js owns the dark and light values). */

@media (prefers-reduced-motion: reduce) {
  .nx-home--mindmap .mm-ring,
  .nx-home--mindmap .mm-ring-orbit,
  .nx-home--mindmap .mm-node-label,
  .nx-home--mindmap .mm-node-desc,
  .nx-home--mindmap .mm-line { transition:none !important; }
}
/* ─── End Mind Map ─── */

/* ═══════════════════ FREEFORM ═══════════════════ */
.nx-home--freeform { position:fixed; z-index:2; background:var(--bg-0) !important; }
body.light-mode .nx-home--freeform { background:
    radial-gradient(ellipse 45% 40% at 50% 50%, rgba(13,148,136,0.06), transparent 75%),
    radial-gradient(ellipse 65% 55% at 50% 50%, #FAF7F0 0%, #F5F2EB 55%, #E8E2D2 100%),
    #E8E2D2 !important; }
/* Freeform's box (above) and its layers keep position:fixed, exactly as they were before the move. It is right in
   both places: on home the box is the window, and in a miniature the box is absolute in its frame and, being
   scaled, is itself the frame its fixed children hang on (a transformed element is one). It is kept because the
   browser draws fixed layers on their own surface: as position:absolute the same fills come out dithered
   differently (faint, but not the same pixels as before). A new layout should use position:absolute in its box. */
.nx-home--freeform .ff-canvas {
  position:fixed; inset:0;
  background: radial-gradient(circle at 50% 50%, var(--grad-mindmap-0) 0%, var(--grad-mindmap-1) 45%, var(--grad-mindmap-2) 100%);
  transition: background 0.4s ease;
  /* the top edge runs from the 45% stop (centre) to the edge stop (corners): their midpoint */
  --nx-titlebar: color-mix(in srgb, var(--grad-mindmap-1) 50%, var(--grad-mindmap-2));
}
body.light-mode .nx-home--freeform .ff-canvas {
  background:
    radial-gradient(ellipse 45% 40% at 50% 50%, rgba(13,148,136,0.06), transparent 75%),
    radial-gradient(ellipse 65% 55% at 50% 50%, #FAF7F0 0%, #F5F2EB 55%, #E8E2D2 100%),
    #E8E2D2;
  --nx-titlebar: #E8E2D2;
}
.nx-home--freeform .ff-dots {
  position:absolute; inset:0; pointer-events:none;
  background-image: radial-gradient(circle, rgba(var(--accent-rgb),0.18) 1px, transparent 1.4px);
  background-size: 40px 40px;
  background-position: 0 0;
  mask-image: radial-gradient(ellipse 75% 70% at 50% 50%, black 30%, rgba(0,0,0,0.5) 70%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 50%, black 30%, rgba(0,0,0,0.5) 70%, transparent 100%);
}
body.light-mode .nx-home--freeform .ff-dots {
  background-image: radial-gradient(circle, rgba(0,0,0,0.06) 1px, transparent 1.4px);
}
.nx-home--freeform .ff-pill-layer {
  position:fixed; inset:0; width:100%; height:100%; pointer-events:none; z-index:1;
}
.nx-home--freeform .ff-hint {
  position:fixed; bottom:76px; left:28px; z-index:50;
  font-family:'Plus Jakarta Sans', sans-serif;
  font-size:10px; letter-spacing:1.5px; text-transform:uppercase;
  color:rgba(255,255,255,0.3);
  pointer-events:none;
  transition:left 0.3s ease, right 0.3s ease;
}
body.light-mode .nx-home--freeform .ff-hint { color:rgba(15,22,38,0.35); }
.nx-home--freeform .ff-nodes { position:fixed; inset:0; z-index:5; pointer-events:none; }
.nx-home--freeform .ff-node {
  position:absolute; width:112px; height:112px;
  transform:translate(-50%,-50%);
  cursor:grab; touch-action:none;
  z-index:5; display:flex; align-items:center; justify-content:center;
  pointer-events:auto;
}
.nx-home--freeform .ff-node.ff-locked { cursor:default; }
.nx-home--freeform .ff-node.ff-dragging { z-index:100; cursor:grabbing; }
.nx-home--freeform .ff-icon-wrap {
  width:112px; height:112px;
  display:flex; align-items:center; justify-content:center;
  transition:transform 0.25s ease;
  pointer-events:none;
}
.nx-home--freeform .ff-icon-wrap svg { transition:filter 0.25s ease, transform 0.25s ease; }
.nx-home--freeform .ff-node:not(.ff-dragging):hover .ff-icon-wrap { transform:scale(1.04); }
.nx-home--freeform .ff-node.ff-dragging .ff-icon-wrap { transform:scale(1.10); }
.nx-home--freeform .ff-node-meta {
  position:absolute; transform:translate(-50%,0);
  text-align:center; pointer-events:none; z-index:5; user-select:none;
}
.nx-home--freeform .ff-label {
  font-family:'Plus Jakarta Sans',sans-serif;
  font-size:9px; font-weight:600; letter-spacing:2px; text-transform:uppercase;
  color:rgba(255,255,255,0.5);
  transition:color 0.25s ease; white-space:nowrap;
}
body.light-mode .nx-home--freeform .ff-label { color:rgba(15,22,38,0.55); }
.nx-home--freeform .ff-node-meta.ff-hot .ff-label { color:rgba(255,255,255,0.95); }
body.light-mode .nx-home--freeform .ff-node-meta.ff-hot .ff-label { color:rgba(15,22,38,0.95); }
.nx-home--freeform .ff-reset,
.nx-home--freeform .ff-lock {
  position:fixed; bottom:74px; right:28px; z-index:50;
  background:transparent; border:0; cursor:pointer;
  color:rgba(255,255,255,0.4);
  font-family:'Plus Jakarta Sans',sans-serif;
  font-size:11px; font-weight:500; letter-spacing:3px; text-transform:uppercase;
  padding:8px 4px;
  display:flex; align-items:center; gap:8px;
  transition:color 0.25s ease, right 0.3s ease;
}
.nx-home--freeform .ff-lock { bottom:100px; }
.nx-home--freeform .ff-lock.ff-locked-active { color:var(--accent); }
.nx-home--freeform .ff-reset:hover,
.nx-home--freeform .ff-lock:hover { color:rgba(255,255,255,0.85); }
body.light-mode .nx-home--freeform .ff-reset,
body.light-mode .nx-home--freeform .ff-lock { color:rgba(15,22,38,0.45); }
body.light-mode .nx-home--freeform .ff-reset:hover,
body.light-mode .nx-home--freeform .ff-lock:hover { color:rgba(15,22,38,0.9); }
body.light-mode .nx-home--freeform .ff-lock.ff-locked-active { color:var(--accent-deep); }
.nx-home--freeform .ff-reset svg,
.nx-home--freeform .ff-lock svg { width:14px; height:14px; stroke:currentColor; fill:none; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; }

/* ═══════════════════ HUB GRID ═══════════════════ */
/* Three fixed groups of glass tiles around the logo. Positions are set in drawHubGrid (nx-home.js); the sizes
   here are the fixed ones it places by (HG). The stage is the piece nxHomeFit shrinks in a small box.
   The ground is the home ground Mind map has, without its grid lines. */
.nx-home--hubgrid {
  z-index:1;
  background:
    radial-gradient(ellipse 45% 40% at 50% 50%, rgba(var(--accent-rgb),0.05), transparent 75%),
    radial-gradient(ellipse 65% 55% at 50% 50%, var(--grad-mindmap-0) 0%, var(--grad-mindmap-veil) 55%, transparent 85%),
    var(--grad-mindmap-2);
  --nx-titlebar: var(--grad-mindmap-2);
}
.nx-home--hubgrid .hg-stage { position:absolute; left:0; top:0; transform-origin:0 0; }
/* The glow: one layer as big as the stage, so it paints across the whole home box (it is never cut off at a box
   of its own) and shrinks with the stage in a small box. Three ellipses, front to back, placed from the logo's
   center (--hg-x / --hg-y, set in drawHubGrid): a brighter spot up and to the left, one down and to the right,
   and one wide glow. Each fades to clear at its own edge, so there is no hard edge at any size. The shapes are
   written once; a theme only sets the four strengths (--hg-a1 spot up-left, --hg-a2 spot down-right, --hg-a3 the
   wide glow's center, --hg-a4 the wide glow at 55%). */
.nx-home--hubgrid .hg-glow {
  position:absolute; inset:0; pointer-events:none;
  --hg-x:50%; --hg-y:48.889%;
  --hg-a1:0.13; --hg-a2:0.12; --hg-a3:0.17; --hg-a4:0.09;
  background:
    radial-gradient(ellipse 400px 270px at calc(var(--hg-x) - 305px) calc(var(--hg-y) - 135px), rgba(34,211,238,var(--hg-a1)) 0%, rgba(34,211,238,0) 100%),
    radial-gradient(ellipse 360px 270px at calc(var(--hg-x) + 365px) calc(var(--hg-y) + 205px), rgba(16,185,129,var(--hg-a2)) 0%, rgba(16,185,129,0) 100%),
    radial-gradient(ellipse 930px 540px at var(--hg-x) calc(var(--hg-y) + 60px), rgba(34,211,238,var(--hg-a3)) 0%, rgba(16,185,129,var(--hg-a4)) 55%, rgba(16,185,129,0) 100%);
}
.nx-home--hubgrid .hg-lines { position:absolute; left:0; top:0; width:100%; height:100%; pointer-events:none; }
.nx-home--hubgrid .hg-line { fill:none; stroke:rgba(255,255,255,0.16); stroke-width:1; }
.nx-home--hubgrid .hg-dot { fill:var(--muted); }
.nx-home--hubgrid .hg-logo { position:absolute; display:block; width:150px; height:150px; pointer-events:none; }
.nx-home--hubgrid .hg-label {
  position:absolute; transform:translateY(-100%); pointer-events:none; white-space:nowrap;
  font-family:'Plus Jakarta Sans',sans-serif; font-size:11px; font-weight:700; line-height:14px;
  letter-spacing:0.12em; text-transform:uppercase; color:var(--nx-text-dim);
}
/* Glass on these tiles is an approved exception to "glass only on the top bar" (same blur as the top bar). */
.nx-home--hubgrid .hg-tile {
  position:absolute; box-sizing:border-box; width:270px; height:76px; margin:0; padding:0 18px;
  display:flex; align-items:center; gap:14px;
  border:1px solid rgba(255,255,255,0.09); border-radius:14px;
  background-color:rgba(255,255,255,0.045);
  -webkit-backdrop-filter:blur(24px) saturate(150%); backdrop-filter:blur(24px) saturate(150%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.07);
  font:inherit; text-align:left; color:var(--text); cursor:pointer;
}
/* Hover: the app's hover fill over the glass (the glass is the background color, the hover fill a layer on it) */
.nx-home--hubgrid .hg-tile:hover { background-image:linear-gradient(var(--nx-hover-fill), var(--nx-hover-fill)); }
.nx-home--hubgrid .hg-tile:focus-visible { outline:2px solid var(--nx-focus); outline-offset:2px; }
.nx-home--hubgrid .hg-tile-icon { flex:0 0 36px; height:36px; line-height:0; }
.nx-home--hubgrid .hg-tile-text { min-width:0; display:flex; flex-direction:column; gap:2px; }
.nx-home--hubgrid .hg-tile-name {
  font-family:'Plus Jakarta Sans',sans-serif; font-size:15px; font-weight:700; line-height:20px; color:var(--text);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.nx-home--hubgrid .hg-tile-desc {
  font-family:'Plus Jakarta Sans',sans-serif; font-size:12.5px; font-weight:500; line-height:16px; color:var(--text2);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
/* ─── Light mode: Hub Grid (Mind map's light ground; the top bar's light glass; the glow keeps its shapes and colors, at lower strengths) ─── */
body.light-mode .nx-home--hubgrid {
  background:
    radial-gradient(ellipse 45% 40% at 50% 50%, rgba(13,148,136,0.06), transparent 75%),
    radial-gradient(ellipse 65% 55% at 50% 50%, #FAF7F0 0%, #F5F2EB 55%, #E8E2D2 100%),
    #E8E2D2 !important;
  --nx-titlebar: #E8E2D2;
}
/* The same glow at about six tenths of the strength: at full strength the cream ground turns mint and grays at the fringe */
body.light-mode .nx-home--hubgrid .hg-glow { --hg-a1:0.08; --hg-a2:0.07; --hg-a3:0.10; --hg-a4:0.055; }
body.light-mode .nx-home--hubgrid .hg-line { stroke:var(--nx-line-strong); }
body.light-mode .nx-home--hubgrid .hg-tile {
  background-color:rgba(255,255,255,0.55); border-color:rgba(0,0,0,0.08);
  box-shadow:inset 0 1px 0 rgba(255,255,255,0.04);
}
/* ─── End Hub Grid ─── */

/* ═══════════════════ ARCH ═══════════════════ */
/* The modules on one arc over the logo. Positions and the arc line are set in drawArch (nx-home.js); the sizes
   here are the fixed ones (AR). The stage is the piece nxHomeFit shrinks in a small box. Nothing is painted in
   a node's disc or behind its words: the arc line ends at each disc's edge and gives way to every name and to
   the space every hover description uses (arLine), so it is right on any ground.
   The ground is the home ground Mind map has, without its grid lines. */
.nx-home--arch {
  z-index:1;
  background:
    radial-gradient(ellipse 45% 40% at 50% 50%, rgba(var(--accent-rgb),0.05), transparent 75%),
    radial-gradient(ellipse 65% 55% at 50% 50%, var(--grad-mindmap-0) 0%, var(--grad-mindmap-veil) 55%, transparent 85%),
    var(--grad-mindmap-2);
  --nx-titlebar: var(--grad-mindmap-2);
}
.nx-home--arch .ar-stage { position:absolute; left:0; top:0; transform-origin:0 0; }
.nx-home--arch .ar-glow {
  position:absolute; width:300px; height:300px; margin:-150px 0 0 -150px; pointer-events:none;
  background:radial-gradient(circle closest-side, rgba(34,211,238,0.07) 0%, rgba(34,211,238,0) 70%);
}
.nx-home--arch .ar-lines { position:absolute; left:0; top:0; width:100%; height:100%; pointer-events:none; }
.nx-home--arch .ar-arc { fill:none; stroke:rgba(255,255,255,0.16); stroke-width:1; }
.nx-home--arch .ar-logo { position:absolute; display:block; width:170px; height:170px; pointer-events:none; }
/* A node: an 88px round button centered on its spot */
.nx-home--arch .ar-node {
  position:absolute; width:88px; height:88px; margin:-44px 0 0 -44px; padding:0; border:0; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:transparent; font:inherit; color:inherit; cursor:pointer; outline:none;
}
.nx-home--arch .ar-node-icon { display:block; width:52px; height:52px; line-height:0; }
.nx-home--arch .ar-node-label {
  position:absolute; left:50%; transform:translateX(-50%); top:calc(100% + 6px);
  padding-left:2.2px; /* balances the trailing letter-spacing, so the label centers */
  font-family:'Plus Jakarta Sans',sans-serif; font-weight:700; font-size:12px; line-height:16px;
  letter-spacing:2.2px; text-transform:uppercase; color:#BAC2CE;
  white-space:nowrap; transition:color .25s ease;
}
/* One-line description, faded in under the label on hover: it sits on nothing's place, so nothing moves */
.nx-home--arch .ar-node-desc {
  position:absolute; left:50%; transform:translateX(-50%); top:calc(100% + 26px);
  font-family:'Plus Jakarta Sans',sans-serif; font-weight:500; font-size:11.5px; line-height:14px;
  letter-spacing:.3px; color:#BAC2CE; white-space:nowrap;
  opacity:0; pointer-events:none; transition:opacity .25s ease;
}
.nx-home--arch .ar-node:hover .ar-node-desc,
.nx-home--arch .ar-node:focus-visible .ar-node-desc { opacity:1; }
.nx-home--arch .ar-node:hover .ar-node-label,
.nx-home--arch .ar-node:focus-visible .ar-node-label { color:#FFFFFF; }
.nx-home--arch .ar-node:focus-visible { outline:2px solid var(--nx-focus); outline-offset:2px; }
/* ─── Light mode: Arch (Mind map's light ground, label colors and light teal at half strength) ─── */
body.light-mode .nx-home--arch {
  background:
    radial-gradient(ellipse 45% 40% at 50% 50%, rgba(13,148,136,0.06), transparent 75%),
    radial-gradient(ellipse 65% 55% at 50% 50%, #FAF7F0 0%, #F5F2EB 55%, #E8E2D2 100%),
    #E8E2D2 !important;
  --nx-titlebar: #E8E2D2;
}
body.light-mode .nx-home--arch .ar-glow {
  background:radial-gradient(circle closest-side, rgba(13,148,136,0.035) 0%, rgba(13,148,136,0) 70%);
}
body.light-mode .nx-home--arch .ar-arc { stroke:var(--nx-line-strong); }
body.light-mode .nx-home--arch .ar-node-label,
body.light-mode .nx-home--arch .ar-node-desc { color:#5C6677; }
body.light-mode .nx-home--arch .ar-node:hover .ar-node-label,
body.light-mode .nx-home--arch .ar-node:focus-visible .ar-node-label { color:#0F1626; }
@media (prefers-reduced-motion: reduce) {
  .nx-home--arch .ar-node-label,
  .nx-home--arch .ar-node-desc { transition:none !important; }
}
/* ─── End Arch ─── */

/* ═══════════════════ COMMAND ═══════════════════ */
/* Search first: a small logo, the contact search as one big box, the modules in one row, the recent contacts.
   Everything sits on one board (1040 x 900) at the fixed places below; drawCommand (nx-home.js) centers the
   board in the stage, and the stage is the piece nxHomeFit shrinks in a small box. The rows inside the results
   list and Recent are the top bar search's own (.contact-search-*, drawn by ContactSearch): only their sizes
   on this board are set here. Colors are tokens, so light mode and a company color need nothing of their own.
   The ground is the home ground Mind map has, without its grid lines: no glow, no lines. Dashboard stands on the
   same ground, so the one declaration is for both. */
.nx-home--dashboard,
.nx-home--command {
  z-index:1;
  background:
    radial-gradient(ellipse 45% 40% at 50% 50%, rgba(var(--accent-rgb),0.05), transparent 75%),
    radial-gradient(ellipse 65% 55% at 50% 50%, var(--grad-mindmap-0) 0%, var(--grad-mindmap-veil) 55%, transparent 85%),
    var(--grad-mindmap-2);
  --nx-titlebar: var(--grad-mindmap-2);
}
.nx-home--command .cm-stage { position:absolute; left:0; top:0; transform-origin:0 0; }
.nx-home--command .cm-board { position:absolute; width:1040px; height:900px; font-family:'Plus Jakarta Sans',sans-serif; }
.nx-home--command .cm-logo { position:absolute; left:492px; top:148px; display:block; width:56px; height:56px; pointer-events:none; }
/* The box: 640 x 60. The field inside is bare; the box carries the fill, the border and the focus ring. */
.nx-home--command .cm-box {
  position:absolute; left:200px; top:232px; box-sizing:border-box; width:640px; height:60px; margin:0; padding:0 16px 0 18px;
  display:flex; align-items:center; gap:14px;
  border:1px solid var(--nx-line-strong); border-radius:16px; background:var(--card); cursor:text;
}
.nx-home--command .cm-box:focus-within { outline:2px solid var(--nx-focus); outline-offset:2px; }
.nx-home--command .cm-box-icon { flex:0 0 24px; height:24px; line-height:0; }
/* (.cm-box input.cm-input: the field's bare look has to outrank index.html's light-mode rule for every text input) */
.nx-home--command .cm-box input.cm-input {
  flex:1 1 auto; min-width:0; height:100%; margin:0; padding:0;
  background:transparent !important; border:0 !important; border-radius:0 !important; box-shadow:none !important; outline:none !important;
  -webkit-appearance:none; appearance:none; color:var(--text) !important;
  font-family:'Plus Jakarta Sans',sans-serif; font-size:17px; font-weight:500; line-height:1.2;
}
.nx-home--command .cm-input::placeholder { color:var(--muted); opacity:1; }
.nx-home--command .cm-key {
  flex:0 0 auto; padding:3px 8px; border:1px solid var(--nx-line-strong); border-radius:8px;
  font-size:12px; font-weight:600; line-height:16px; color:var(--muted); white-space:nowrap;
}
/* Results: directly under the box, over the module row, while the field holds a query. Empty = not shown. */
.nx-home--command .cm-results {
  position:absolute; left:200px; top:296px; z-index:2; box-sizing:border-box; width:640px; max-height:440px; overflow-y:auto;
  padding:6px 0 10px; border:1px solid var(--nx-line-strong); border-radius:14px; background:var(--card); line-height:1.4;
}
.nx-home--command .cm-results:empty { display:none; }
/* The module row: nine buttons 104 wide, 8 apart (1000 across), in the person's order. The item itself is the
   shared one (.nx-home-mod, under THE MODULE ITEM below); this row sets only its width. */
.nx-home--command .cm-mods { position:absolute; left:20px; top:328px; width:1000px; display:flex; gap:8px; }
.nx-home--command .cm-mod { flex:0 0 104px; width:104px; }
/* Recent: a hairline, the label 16 below it, then the rows, 46 high. With no recent contacts the search writes
   nothing here and the whole block is not shown. */
.nx-home--command .cm-recent {
  position:absolute; left:200px; top:470px; box-sizing:border-box; width:640px; padding-top:16px;
  border-top:1px solid var(--nx-line); line-height:1.4;
}
.nx-home--command .cm-recent:empty { display:none; }
.nx-home--command .cm-recent .contact-search-label {
  height:14px; line-height:14px; margin:0 0 8px; padding:0 18px;
  font-size:11px; font-weight:700; letter-spacing:0.12em; color:var(--muted);
}
.nx-home--command .cm-recent .contact-search-row { box-sizing:border-box; height:46px; padding-top:0; padding-bottom:0; }
.nx-home--command .cm-recent .contact-search-row:focus-visible { outline:2px solid var(--nx-focus); outline-offset:-2px; }
/* ─── Light mode: Command and Dashboard (Mind map's light ground; everything else is tokens) ─── */
body.light-mode .nx-home--dashboard,
body.light-mode .nx-home--command {
  background:
    radial-gradient(ellipse 45% 40% at 50% 50%, rgba(13,148,136,0.06), transparent 75%),
    radial-gradient(ellipse 65% 55% at 50% 50%, #FAF7F0 0%, #F5F2EB 55%, #E8E2D2 100%),
    #E8E2D2 !important;
  --nx-titlebar: #E8E2D2;
}
/* ─── End Command ─── */

/* ═══════════════════ DASHBOARD ═══════════════════ */
/* The person's numbers up top, their modules under them: one block 1160 wide, 150 down a 1160 x 900 board that
   drawDashboard (nx-home.js) centers in the stage; the stage is the piece nxHomeFit shrinks in a small box.
   Inside the block everything is in normal flow: the header (40), 18, four cards (278 x 300, 16 apart), 44, a
   hairline, 20, the "Modules" label, 12, the module row. The ground is the plain home ground it shares with
   Command (the rule is under COMMAND). Every color is a token, so light mode and a company color need nothing
   of their own. The 7 / 30 switch is the shared .nx-seg and the title's menu the shared dropdown, as they are. */
.nx-home--dashboard { font-family:'Plus Jakarta Sans',sans-serif; color:var(--text); }
.nx-home--dashboard .db-stage { position:absolute; left:0; top:0; transform-origin:0 0; }
.nx-home--dashboard .db-board { position:absolute; width:1160px; height:900px; }
.nx-home--dashboard .db-block { position:absolute; left:0; top:150px; width:1160px; }
.nx-home--dashboard .db-head { display:flex; align-items:center; justify-content:space-between; height:40px; }
.nx-home--dashboard .db-label {
  font-size:11px; font-weight:700; line-height:14px; letter-spacing:0.12em; text-transform:uppercase; color:var(--muted);
}
.nx-home--dashboard .db-label--bright { color:var(--text2); }
.nx-home--dashboard .db-cards { display:grid; grid-template-columns:repeat(4, 278px); gap:16px; margin-top:18px; }
/* The card: its parts are always there at full size (title 14, number 48, compare line 16, chart 126), so
   nothing moves when the numbers arrive. The surface is the one Command's search box stands on. */
.nx-home--dashboard .db-card {
  box-sizing:border-box; height:300px; padding:22px 22px 16px;
  display:flex; flex-direction:column; align-items:flex-start; gap:10px;
  border:1px solid var(--nx-line); border-radius:14px; background:var(--card);
  box-shadow:0 18px 40px rgba(0,0,0,0.35);
}
/* The title is a button: the stat's name and a small chevron. A click opens the dropdown under it. */
.nx-home--dashboard .db-title {
  display:inline-flex; align-items:center; gap:4px; height:14px; margin:0; padding:0; border:0; border-radius:4px;
  background:transparent; font:inherit; font-size:11px; font-weight:700; line-height:14px; letter-spacing:0.12em;
  text-transform:uppercase; color:var(--muted); white-space:nowrap; cursor:pointer;
}
.nx-home--dashboard .db-title:hover,
.nx-home--dashboard .db-title[aria-expanded="true"] { color:var(--text2); }
.nx-home--dashboard .db-title:focus-visible { outline:2px solid var(--nx-focus); outline-offset:4px; }
.nx-home--dashboard .db-title-chev { display:inline-flex; line-height:0; }
.nx-home--dashboard .db-num {
  height:48px; font-size:44px; font-weight:800; line-height:48px; letter-spacing:-0.02em;
  font-variant-numeric:tabular-nums; color:var(--text); white-space:nowrap;
}
/* The compare line keeps its height when it is empty (loading). The arrow shows for more (up, the success
   color) and for fewer (the same arrow turned down, in the muted text color); "Same as" has none. */
.nx-home--dashboard .db-cmp {
  display:flex; align-items:center; gap:6px; height:16px;
  font-size:12.5px; font-weight:500; line-height:16px; color:var(--muted); white-space:nowrap;
}
.nx-home--dashboard .db-arrow { display:none; flex:0 0 14px; }
.nx-home--dashboard .db-cmp.is-up .db-arrow { display:block; color:var(--nx-up); }
.nx-home--dashboard .db-cmp.is-down .db-arrow { display:block; color:var(--muted); transform:rotate(180deg); }
/* The chart: 230 x 126 at the bottom of the card. The canvas holds the floor and the raised bars (NxOblique);
   the labels and the hover columns are elements over it, placed by drawDashboard. */
.nx-home--dashboard .db-chart { position:relative; flex:0 0 126px; width:230px; height:126px; margin-top:auto; }
.nx-home--dashboard .db-canvas { position:absolute; left:0; top:0; display:block; width:230px; height:126px; }
.nx-home--dashboard .db-day {
  position:absolute; top:111px; transform:translateX(-50%);
  font-size:10.5px; font-weight:600; line-height:12px; color:var(--muted); white-space:nowrap;
}
.nx-home--dashboard .db-day.is-today { color:var(--text); }
.nx-home--dashboard .db-day--start { transform:none; }
.nx-home--dashboard .db-day--end { transform:translateX(-100%); }
.nx-home--dashboard .db-col { position:absolute; top:0; height:126px; }
/* The modules: a hairline 44 under the cards, 20 of padding, the label, 12, then the row. Nine items 112 wide,
   spread evenly across the block. The item itself is the shared one (.nx-home-mod below). */
.nx-home--dashboard .db-foot { margin-top:44px; padding-top:20px; border-top:1px solid var(--nx-line); }
.nx-home--dashboard .db-mods { display:flex; justify-content:space-between; margin-top:12px; }
.nx-home--dashboard .db-mod { flex:0 0 112px; width:112px; }
/* ─── End Dashboard ─── */

/* ═══════════════════ THE MODULE ITEM (nxHomeModItem) ═══════════════════ */
/* One module in a row of modules (Command, Dashboard): the real icon at 40, 10 under it the name, 14 of padding
   above and below, a hover fill with a 14 radius. One style for every row; a row sets only the item's width. */
.nx-home .nx-home-mod {
  box-sizing:border-box; margin:0; padding:14px 0; border:0; border-radius:14px;
  display:flex; flex-direction:column; align-items:center; gap:10px;
  background:transparent; font:inherit; color:var(--text); cursor:pointer;
}
.nx-home .nx-home-mod:hover { background:var(--nx-hover-fill); }
.nx-home .nx-home-mod:focus-visible { outline:2px solid var(--nx-focus); outline-offset:2px; }
.nx-home .nx-home-mod__icon { display:block; width:40px; height:40px; line-height:0; }
.nx-home .nx-home-mod__name { font-size:12.5px; font-weight:600; line-height:16px; color:var(--text); white-space:nowrap; }

/* ═══════════════════ THE PICKER (NxHome.picker) ═══════════════════ */
/* One .nx-choice card per layout: its live miniature, its name, its description.
   One wrap rule: as many cards to a row as fit at a card's smallest width (its miniature plus its padding and
   border), the row's cards sharing the width. The Appearance card holds three, so six layouts are 3 + 3; a
   narrower card holds two. The miniature keeps its size and sits centered in its card. */
.nx-card__row.nx-home-pick-row { flex-direction:column; align-items:stretch; }
.nx-home-pick { display:grid; grid-template-columns:repeat(auto-fill, minmax(274px, 1fr)); gap:8px; }
.nx-home-card { padding:10px 8px; }
.nx-home-mini { display:block; position:relative; overflow:hidden; isolation:isolate; border-radius:6px; margin:0 auto 8px; }

/* ═══════════════════ MODULE ORDER (NxHome.orderList) ═══════════════════ */
/* The label and help line, one compact list of the modules (rows placed by slot in nx-home.js: a row's height
   is --nx-home-order-row, set there with the list's height), and Reset. */
.nx-home-order { position:relative; display:flex; flex-direction:column; align-items:flex-start; gap:10px; }
.nx-home-order-list { position:relative; list-style:none; margin:0; padding:0; width:280px; max-width:100%; }
.nx-home-order-row {
  position:absolute; left:0; right:0; box-sizing:border-box; height:var(--nx-home-order-row);
  display:flex; align-items:center; gap:8px; padding:0 10px 0 4px;
  border:1px solid var(--nx-line-strong); border-radius:8px; background:var(--nx-field-fill);
  cursor:grab; touch-action:none; user-select:none; -webkit-user-select:none;
  transition:top 120ms ease;
}
.nx-home-order-row.is-dragging { z-index:1; cursor:grabbing; border-color:var(--nx-action-ink); transition:none; }
.nx-home-order-grip {
  flex:0 0 auto; width:24px; height:28px; padding:0; border:0; border-radius:6px;
  display:flex; align-items:center; justify-content:center;
  background:transparent; color:var(--text2); cursor:inherit;
}
.nx-home-order-grip:hover { background:var(--nx-hover-fill); color:var(--text); }
.nx-home-order-grip:focus-visible { outline:2px solid var(--nx-focus); outline-offset:1px; }
.nx-home-order-icon { flex:0 0 auto; display:flex; line-height:0; }
.nx-home-order-name { font-family:var(--font-body); font-size:13px; font-weight:600; line-height:1.3; color:var(--text); }
.nx-home-order-live { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
@media (prefers-reduced-motion: reduce) {
  .nx-home-order-row { transition:none; }
}
