/* DEKS rail: the icon rail and the mask icons, shared by the /next shell
   (next/base.html) and the classic shell (base.html with DEKS_RAIL_NAV).
   Moved out of next.css unchanged except: the look tokens the rail reads are
   declared on .nx-rail itself so it renders outside .nx-clean, item rules
   match a disabled <span class="nx-item nx-off"> as well as links, and
   .nx-rail-fixed pins the rail under the classic top bar.
   The logo tile and avatar keep var(--basalt) / var(--blue-800) from
   next.css's :root: only the /next shell draws them (the classic shell
   passes no rail_logo or rail_who).
   Spec: docs/specs/deks-next-shell.md. */

.nx-rail{--surface:#ffffff;--line:#dad6cb;--line-soft:#eae7de;--ink:#191c1d;--muted:#5d615f;
  --accent:#1769a8;--accent-ink:#155c92;--accent-soft:#eaf1f7;
  font-family:"Inter",system-ui,-apple-system,"Segoe UI",sans-serif;box-sizing:border-box}
.nx-rail *{box-sizing:border-box}

/* ---------- icons (mask) ---------- */
.nx-ico{display:inline-block;width:22px;height:22px;flex-shrink:0;background:currentColor;-webkit-mask:var(--i) center/contain no-repeat;mask:var(--i) center/contain no-repeat}
.nx-ico-sm{width:16px;height:16px}
.nx-ico-home{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M3 10.5 12 3l9 7.5V21h-6v-6H9v6H3z'/%3E%3C/svg%3E")}
.nx-ico-projects{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M12 21s7-6 7-12a7 7 0 0 0-14 0c0 6 7 12 7 12z'/%3E%3Ccircle cx='12' cy='9' r='2.5'/%3E%3C/svg%3E")}
.nx-ico-portfolio{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Ccircle cx='6' cy='7' r='2.5'/%3E%3Ccircle cx='6' cy='17' r='2.5'/%3E%3Ccircle cx='18' cy='12' r='3'/%3E%3Cpath d='M8.4 7.8 15.2 11M8.4 16.2l6.8-3.2'/%3E%3C/svg%3E")}
.nx-ico-tools{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M14.7 6.3a4 4 0 0 0-5.4 5.4L3 18l3 3 6.3-6.3a4 4 0 0 0 5.4-5.4l-2.5 2.5-2.4-.6-.6-2.4z'/%3E%3C/svg%3E")}
.nx-ico-platform{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M4 7h10M18 7h2M4 17h4M12 17h8'/%3E%3Ccircle cx='16' cy='7' r='2'/%3E%3Ccircle cx='10' cy='17' r='2'/%3E%3C/svg%3E")}
.nx-ico-help{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M9.5 9a2.5 2.5 0 1 1 3.5 2.3c-.7.3-1 .9-1 1.7M12 17h.01'/%3E%3C/svg%3E")}
.nx-ico-search{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E")}
.nx-ico-plus{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E")}
.nx-ico-map{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M9 4 3 6v14l6-2 6 2 6-2V4l-6 2z'/%3E%3Cpath d='M9 4v14M15 6v14'/%3E%3C/svg%3E")}
.nx-ico-cost{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M15 9.5c-.5-1-1.6-1.5-3-1.5-1.7 0-3 .9-3 2s1.3 1.7 3 2 3 .9 3 2-1.3 2-3 2c-1.4 0-2.5-.5-3-1.5M12 6v2M12 16v2'/%3E%3C/svg%3E")}
.nx-ico-well{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3h8l-2 4h-4zM12 7v8c0 2 1 4 4 5M3 21h18'/%3E%3C/svg%3E")}
.nx-ico-data{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Cellipse cx='12' cy='6' rx='8' ry='3'/%3E%3Cpath d='M4 6v12c0 1.7 3.6 3 8 3s8-1.3 8-3V6M4 12c0 1.7 3.6 3 8 3s8-1.3 8-3'/%3E%3C/svg%3E")}
.nx-ico-pipe{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M3 9h7v6h11M3 6v6M21 12v6'/%3E%3C/svg%3E")}
.nx-ico-plant{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M3 21V11l5 3V11l5 3V5h4l1 16zM3 21h18'/%3E%3C/svg%3E")}
.nx-ico-flame{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M12 3c1 4 5 5 5 10a5 5 0 0 1-10 0c0-2 1-3 2-4 0 2 1 3 2 3 0-3-1-6 1-9z'/%3E%3C/svg%3E")}
.nx-ico-leaf{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M5 19c0-8 5-14 15-14 0 10-6 15-14 15M5 19l7-7'/%3E%3C/svg%3E")}
.nx-ico-school{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='m2 9 10-5 10 5-10 5z'/%3E%3Cpath d='M6 11v5c3 2 9 2 12 0v-5'/%3E%3C/svg%3E")}
.nx-ico-shield{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M12 3 4 6v6c0 5 3.5 8 8 9 4.5-1 8-4 8-9V6z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E")}
.nx-ico-layers{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M3 8c3-2 6 2 9 0s6-2 9 0M3 13c3-2 6 2 9 0s6-2 9 0M3 18c3-2 6 2 9 0s6-2 9 0'/%3E%3C/svg%3E")}
.nx-ico-plan{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='6' cy='6' r='2'/%3E%3Ccircle cx='18' cy='8' r='2'/%3E%3Ccircle cx='9' cy='17' r='2'/%3E%3Cpath d='M8 6.5 16 7.5M17 10l-6.5 5.5M6.5 8l2 7'/%3E%3C/svg%3E")}
.nx-ico-flag{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M5 21V4M5 4h11l-2 4 2 4H5'/%3E%3C/svg%3E")}
.nx-ico-handshake{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M2 12l4-4 4 2 3-2 4 1 5 4-6 5-5-4-3 2zM10 10l3 3'/%3E%3C/svg%3E")}
.nx-ico-chart{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M4 19V9M10 19V5M16 19v-7M22 19H2'/%3E%3C/svg%3E")}
.nx-ico-file{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M6 3h8l5 5v13H6z'/%3E%3Cpath d='M14 3v5h5'/%3E%3C/svg%3E")}
.nx-ico-check{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E")}
.nx-ico-x{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E")}
.nx-ico-clock{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E")}
.nx-ico-arrow{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E")}
.nx-ico-lock{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E")}
.nx-ico-globe{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18'/%3E%3C/svg%3E")}
.nx-ico-building{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M4 21V5l8-2v18M12 8h8v13M4 21h18M7 8h2M7 12h2M7 16h2M15 12h2M15 16h2'/%3E%3C/svg%3E")}
.nx-ico-book{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M4 5a2 2 0 0 1 2-2h14v16H6a2 2 0 0 0-2 2zM4 21V5M8 7h8'/%3E%3C/svg%3E")}
.nx-ico-curve{--i:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='M6 6c2 8 6 11 14 12'/%3E%3C/svg%3E")}

/* ---------- rail ---------- */
.nx-rail{flex:0 0 auto;display:flex;flex-direction:column;align-items:center;gap:4px;padding:14px 0;background:var(--surface);border-right:1px solid var(--line);width:84px}
.nx-rail .nx-logo{width:42px;height:42px;border-radius:12px;display:flex;align-items:center;justify-content:center;background:var(--basalt);margin-bottom:6px}
.nx-rail .nx-logo img{width:32px;height:32px}
.nx-rail .nx-new{width:44px;height:44px;border-radius:50%;border:0;background:var(--accent);color:#fff;display:flex;align-items:center;justify-content:center;margin-bottom:10px}
.nx-rail .nx-new:hover{background:var(--accent-ink)}
.nx-rail .nx-new-label{display:none}
.nx-rail .nx-item{width:72px;min-height:56px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;border-radius:12px;color:var(--muted);font-size:12px;font-weight:500}
.nx-rail .nx-item .nx-ri{width:44px;height:32px;border-radius:10px;display:flex;align-items:center;justify-content:center}
.nx-rail .nx-item:hover .nx-ri{background:var(--line-soft)}
.nx-rail .nx-item.nx-on{color:var(--ink)}
.nx-rail .nx-item.nx-on .nx-ri{background:var(--accent-soft);color:var(--accent)}
.nx-rail .nx-spacer{flex:1}
.nx-rail .nx-avatar{width:36px;height:36px;border-radius:50%;background:var(--blue-800);color:#fff;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:600;margin-top:6px}
.nx-rail .nx-sec,.nx-rail .nx-recent,.nx-rail .nx-who{display:none}
.nx-rail .nx-item[aria-current="page"]{color:var(--ink)}
.nx-rail .nx-item[aria-current="page"] .nx-ri{background:var(--accent-soft);color:var(--accent)}
.nx-rail a.nx-item,.nx-rail button.nx-new{text-decoration:none;cursor:pointer}
.nx-rail .nx-item.nx-off{opacity:.45;cursor:not-allowed}
.nx-rail .nx-item.nx-off:hover .nx-ri{background:transparent}
.nx-rail :focus-visible{outline:2px solid var(--accent);outline-offset:2px}
/* Classic shell: fixed under the 56px top bar. */
.nx-rail-fixed{position:fixed;top:var(--deks-shell-top,56px);bottom:0;left:0;z-index:40;overflow-y:auto}

/* ---------- phone (<=760px): the rail becomes a bottom bar ---------- */
@media (max-width:760px){
  .nx-rail{order:2;position:sticky;bottom:0;z-index:5;width:100%;flex-direction:row;align-items:stretch;justify-content:space-around;gap:0;padding:4px 6px;border-right:0;border-top:1px solid var(--line)}
  .nx-rail .nx-logo,.nx-rail .nx-new,.nx-rail .nx-sec,.nx-rail .nx-recent,.nx-rail .nx-who,.nx-rail .nx-spacer,.nx-rail .nx-avatar{display:none}
  .nx-rail .nx-item{flex:1;width:auto;min-height:54px;flex-direction:column;justify-content:center;gap:2px;padding:0;font-size:12px}
  .nx-rail-fixed{position:fixed;top:auto;bottom:0;left:0;right:0;z-index:50;overflow:visible}
  /* Eight items do not fit a phone: Admin stays in the user menu, Lab is desktop work. */
  .nx-rail-fixed [data-rail="lab"],.nx-rail-fixed [data-rail="admin"]{display:none}
}
