/* D-MASH network, manifesto and control-room surfaces */
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.network-page {
  background:
    radial-gradient(70% 60% at 50% 28%, rgba(73, 89, 171, .18), transparent 70%),
    var(--bg);
}

.network-hero { padding-bottom: 2.2rem; }
.network-intro { display: grid; grid-template-columns: 1.45fr .55fr; gap: 5vw; align-items: end; }
.network-intro h1 { font-size: clamp(3rem, 8vw, 7rem); letter-spacing: -.07em; line-height: .9; max-width: 9ch; }
.network-intro .lead { margin-top: 1.6rem; }
.network-intro-aside { border-left: 1px solid var(--border); padding-left: 1.4rem; }
.network-intro-aside strong { display: block; margin: 1.1rem 0 .3rem; font-family: "JetBrains Mono", monospace; font-size: .92rem; }
.network-live { display: inline-flex; align-items: center; gap: .55rem; color: #aeb9da; text-transform: uppercase; letter-spacing: .12em; font-size: .68rem; }
.network-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--secondary); box-shadow: 0 0 0 5px rgba(14, 201, 154, .12); animation: networkPulse 2.4s ease-in-out infinite; }

.graph-section { padding: 1rem 0 5rem; }
.graph-toolbar { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.graph-filters { display: flex; flex-wrap: wrap; gap: .5rem; }
.graph-filter { appearance: none; border: 1px solid var(--border); background: rgba(8, 16, 33, .65); color: var(--muted); border-radius: 999px; padding: .65rem .9rem; font: 600 .78rem/1 "Manrope", sans-serif; cursor: pointer; transition: transform .3s var(--ease-apple), color .3s, border-color .3s, background .3s; }
.graph-filter::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: .5rem; border-radius: 50%; background: var(--filter-color); }
.graph-filter:hover, .graph-filter.is-active { color: var(--text); border-color: color-mix(in srgb, var(--filter-color) 62%, transparent); background: color-mix(in srgb, var(--filter-color) 12%, rgba(8, 16, 33, .85)); transform: translateY(-1px); }
.graph-legend { display: flex; gap: 1rem; color: var(--muted); font-size: .72rem; white-space: nowrap; }
.graph-legend span { display: flex; align-items: center; gap: .35rem; }
.graph-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend-member { background: #7f8cff; }
.legend-open { border: 1px dashed #9eabcb; }
.graph-legend .legend-edge { width: 18px; height: 1px; border-radius: 0; background: #7180a9; }

.competency-graph { position: relative; height: clamp(560px, 67vw, 720px); overflow: hidden; isolation: isolate; border: 1px solid rgba(145, 163, 255, .2); border-radius: 28px; background: rgba(5, 11, 24, .88); box-shadow: 0 34px 90px rgba(0, 4, 14, .42), inset 0 1px 0 rgba(255, 255, 255, .04); }
.competency-graph::before { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: -1; background: radial-gradient(340px circle at var(--graph-x, 50%) var(--graph-y, 50%), rgba(127, 140, 255, .11), transparent 66%); }
.competency-graph::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: -1; background: radial-gradient(circle at 50% 50%, rgba(127, 140, 255, .08), transparent 30%); }
.graph-canvas { display: block; width: 100%; height: 100%; touch-action: pan-y pinch-zoom; cursor: grab; background-image: linear-gradient(rgba(145,163,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(145,163,255,.045) 1px, transparent 1px); background-size: 42px 42px; }
.graph-canvas.is-panning { cursor: grabbing; }
.graph-viewport { transform-origin: 0 0; transition: transform .25s var(--ease-apple); }
.graph-canvas.is-panning .graph-viewport, .graph-node-svg.is-dragging { transition: none; }
.graph-zone-svg rect { fill: color-mix(in srgb, var(--zone-color) 4%, transparent); stroke: color-mix(in srgb, var(--zone-color) 18%, transparent); stroke-width: 1; stroke-dasharray: 5 7; }
.graph-zone-title { fill: color-mix(in srgb, var(--zone-color) 68%, #b9c5e3); font: 600 12px "JetBrains Mono", monospace; letter-spacing: 1.7px; text-transform: uppercase; }
.graph-zone-description { fill: rgba(183,195,224,.38); font: 10px "JetBrains Mono", monospace; }
.graph-edge { stroke: rgba(151,168,216,.55); stroke-width: 1.4; stroke-dasharray: 8 9; vector-effect: non-scaling-stroke; animation: graphLine 5s linear infinite; }
.graph-node-svg { cursor: pointer; outline: none; animation: graphCoreIn .65s var(--ease-spring) var(--node-delay, 0ms) both; }
.graph-node-svg.is-dragging { cursor: grabbing; }
.graph-node-core { fill: color-mix(in srgb, var(--node-color) 12%, #0b1428); stroke: color-mix(in srgb, var(--node-color) 72%, #fff); stroke-width: 1.3; transition: fill .3s, stroke-width .3s, filter .3s; }
.graph-node-halo { fill: color-mix(in srgb, var(--node-color) 5%, transparent); stroke: color-mix(in srgb, var(--node-color) 24%, transparent); stroke-width: 1; stroke-dasharray: 3 6; }
.graph-node-svg-open .graph-node-core { stroke-dasharray: 5 5; }
.graph-node-svg:hover .graph-node-core, .graph-node-svg:focus-visible .graph-node-core, .graph-node-svg.is-dragging .graph-node-core { fill: color-mix(in srgb, var(--node-color) 23%, #0b1428); stroke-width: 2.5; filter: drop-shadow(0 15px 18px rgba(0,4,14,.52)); }
.graph-node-svg image { pointer-events: none; }
.graph-node-mark { fill: var(--node-color); font: 300 30px "Manrope", sans-serif; text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.graph-node-title { fill: #f2f5ff; font: 700 11px "Manrope", sans-serif; text-anchor: middle; pointer-events: none; }
.graph-node-subtitle { fill: #9eabc9; font: 9px "JetBrains Mono", monospace; text-anchor: middle; pointer-events: none; }
.graph-controls { position: absolute; right: 16px; top: 16px; z-index: 8; display: flex; overflow: hidden; border: 1px solid rgba(145,163,255,.22); border-radius: 12px; background: rgba(8,16,33,.88); backdrop-filter: blur(12px); }
.graph-controls button { width: 42px; height: 42px; border: 0; border-right: 1px solid rgba(145,163,255,.17); color: #dfe6fa; background: transparent; font: 500 19px "JetBrains Mono", monospace; cursor: pointer; transition: background .2s, color .2s; }
.graph-controls button:last-child { border-right: 0; }
.graph-controls button:hover, .graph-controls button:focus-visible { color: #fff; background: rgba(127,140,255,.16); outline: none; }
.graph-hint { position: absolute; left: 18px; bottom: 12px; z-index: 7; margin: 0; color: rgba(178,190,219,.52); font: 10px "JetBrains Mono", monospace; pointer-events: none; }
.graph-popover { position: absolute; left: var(--popover-x); top: var(--popover-y); width: min(310px, calc(100% - 2rem)); padding: 1rem; border: 1px solid var(--border); border-radius: 14px; background: rgba(12, 22, 42, .96); backdrop-filter: blur(16px); box-shadow: 0 24px 60px rgba(0, 4, 14, .56); transform: translate(-50%, calc(-100% - 70px)); z-index: 9; pointer-events: none; animation: popoverIn .25s var(--ease-apple); }
.graph-popover.is-below { transform: translate(-50%, 70px); }
.graph-popover-label { color: var(--focus); font: .62rem "JetBrains Mono", monospace; text-transform: uppercase; letter-spacing: .08em; }
.graph-popover strong { display: block; margin-top: .35rem; }
.graph-popover p { margin: .45rem 0; font-size: .78rem; line-height: 1.5; }
.graph-popover small { color: #c2cbe2; font: .62rem "JetBrains Mono", monospace; }
.competency-graph.has-error { min-height: 280px; opacity: .7; }
.graph-noscript { padding: 1rem; border: 1px solid var(--border); }

.network-principle { border-top: 1px solid rgba(145, 163, 255, .12); }
.network-principle h2 { max-width: 15ch; font-size: clamp(2rem, 4vw, 3.8rem); letter-spacing: -.045em; }
.text-link { font-weight: 800; }
.network-join-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 5vw; align-items: start; }

.member-page { min-height: 75vh; }
.member-profile-main { display: grid; grid-template-columns: 1fr minmax(240px, 390px); gap: 5vw; align-items: center; }
.member-profile-main h1 { font-size: clamp(2.6rem, 6vw, 5.5rem); letter-spacing: -.06em; max-width: 11ch; }
.member-avatar { margin: 0; border-radius: 28px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); }
.member-avatar img { aspect-ratio: 4 / 5; object-fit: cover; }
.member-detail-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 0; margin-top: 5rem; border-top: 1px solid var(--border); }
.member-detail-grid section { padding: 2rem 2rem 2rem 0; border-right: 1px solid var(--border); }
.member-detail-grid section + section { padding-left: 2rem; }
.member-detail-grid section:last-child { border-right: 0; }
.detail-number { color: var(--focus); font: .68rem "JetBrains Mono", monospace; }
.member-tags, .member-projects { margin: 1rem 0 0; padding: 0; list-style: none; display: flex; gap: .45rem; flex-wrap: wrap; }
.member-tags li, .member-projects li { border: 1px solid var(--border); border-radius: 999px; padding: .5rem .7rem; color: #c6d0e9; font-size: .75rem; }
.member-loading { padding: 5rem 0; }

.manifesto-page { background: #080e1a; }
.manifesto-hero { padding: 8rem 0 6rem; border-bottom: 1px solid var(--border); background: radial-gradient(60% 120% at 85% 0%, rgba(108,125,255,.16), transparent 70%); }
.manifesto-hero-grid { display: grid; grid-template-columns: 1.45fr .55fr; gap: 7vw; align-items: end; }
.manifesto-hero h1 { font-size: clamp(3rem, 7vw, 6.5rem); max-width: 10ch; letter-spacing: -.065em; line-height: .92; }
.manifesto-thesis { margin-top: 2.5rem; max-width: 66ch; font-size: clamp(1.05rem, 2vw, 1.4rem); color: #b2bdd8; }
.manifesto-thesis strong { color: var(--text); }
.manifesto-hero aside { border-left: 1px solid var(--border); padding-left: 1.4rem; }
.manifesto-hero aside span { font: .68rem "JetBrains Mono", monospace; text-transform: uppercase; letter-spacing: .12em; color: var(--focus); }
.manifesto-body { padding: 6rem 0; }
.manifesto-layout { display: grid; grid-template-columns: 90px minmax(0, 760px); gap: 6vw; justify-content: center; }
.manifesto-index { position: sticky; top: 100px; align-self: start; display: grid; gap: .35rem; }
.manifesto-index span { color: var(--muted); font: .62rem "JetBrains Mono", monospace; text-transform: uppercase; letter-spacing: .1em; margin-bottom: .45rem; }
.manifesto-index a { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; color: var(--muted); font: .65rem "JetBrains Mono", monospace; transition: color .25s, border-color .25s, transform .25s; }
.manifesto-index a:hover { color: var(--text); border-color: var(--focus); transform: translateX(3px); text-decoration: none; }
.manifesto-preface { font-size: 1.25rem; margin: 0 0 4rem; }
.manifesto-articles article { scroll-margin-top: 100px; padding: 1.5rem 0 5rem; border-top: 1px solid var(--border); }
.manifesto-articles article > span { display: block; color: var(--focus); font: .7rem "JetBrains Mono", monospace; margin-bottom: .8rem; }
.manifesto-articles h2 { font-size: clamp(2rem, 4vw, 3.25rem); letter-spacing: -.045em; margin-bottom: 1.5rem; }
.manifesto-articles p, .manifesto-articles li { font-size: 1.03rem; line-height: 1.85; }
.manifesto-articles strong { color: var(--text); }
.manifesto-articles blockquote, .manifesto-contract blockquote, .manifesto-finale blockquote { margin: 2rem 0; padding: .4rem 0 .4rem 1.4rem; border-left: 2px solid var(--secondary); color: var(--text); font-size: clamp(1.2rem, 2.6vw, 1.8rem); line-height: 1.5; font-weight: 700; }
.manifesto-rhythm { list-style: none; padding: 0; margin: 1.5rem 0; color: #c5cee4; }
.manifesto-contract { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: #0b1428; }
.manifesto-contract .container, .manifesto-finale .container { max-width: 900px; }
.manifesto-contract h2, .manifesto-finale h2 { margin-top: .8rem; font-size: clamp(2rem, 4.5vw, 4rem); letter-spacing: -.05em; }
.manifesto-finale { padding-top: 7rem; padding-bottom: 7rem; }
.manifesto-final-line { margin-top: 2rem; }
.manifesto-sign { display: flex; align-items: center; gap: 1rem; margin: 5rem 0 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.manifesto-sign img { width: 60px; height: 60px; object-fit: contain; }
.manifesto-sign strong, .manifesto-sign span { display: block; }
.manifesto-sign span { color: var(--muted); }
.manifesto-doubt { color: #74809e; font: .72rem/1.6 "JetBrains Mono", monospace; max-width: 70ch; }

.admin-page { background: #080d18; min-height: 100dvh; }
.admin-header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 1.4rem; border-bottom: 1px solid var(--border); background: #0a1120; }
.admin-public-link { font-size: .82rem; font-weight: 700; }
.admin-login { min-height: calc(100dvh - 72px); display: grid; place-items: center; padding: 1.2rem; }
.admin-login-panel { width: min(480px, 100%); padding: 2rem; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.admin-login-panel form { margin-top: 1.5rem; display: grid; gap: 1rem; }
.admin-workspace { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: calc(100dvh - 72px); }
.admin-sidebar { position: sticky; top: 0; height: calc(100dvh - 72px); padding: 1.5rem; border-right: 1px solid var(--border); display: flex; flex-direction: column; background: #0a1120; }
.admin-sidebar strong, .admin-sidebar span { display: block; }
.admin-kicker { color: var(--focus); font: .65rem "JetBrains Mono", monospace; letter-spacing: .12em; }
.admin-sidebar nav { display: grid; gap: .4rem; margin-top: 2.4rem; }
.admin-sidebar nav a { padding: .7rem; border-radius: 8px; color: var(--muted); font-weight: 700; font-size: .84rem; }
.admin-sidebar nav a:hover { background: rgba(108,125,255,.1); color: var(--text); text-decoration: none; }
.admin-logout, .admin-editor-top button, .admin-link-danger { border: 0; background: transparent; color: var(--muted); font: 600 .78rem "Manrope", sans-serif; cursor: pointer; }
.admin-logout { margin-top: auto; text-align: left; }
.admin-content { width: min(1340px, 100%); padding: 2.5rem; overflow: hidden; }
.admin-title-row, .admin-section-heading { display: flex; justify-content: space-between; gap: 2rem; align-items: end; }
.admin-title-row h1 { font-size: clamp(2.3rem, 5vw, 4.5rem); letter-spacing: -.06em; }
.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 2rem; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.admin-stats article { padding: 1.4rem; border-right: 1px solid var(--border); }
.admin-stats article:first-child { padding-left: 0; }
.admin-stats article:last-child { border-right: 0; }
.admin-stats span { color: var(--text); font: 500 clamp(2rem, 5vw, 4rem) "JetBrains Mono", monospace; }
.admin-stats p { margin: 0; font-size: .78rem; }
.admin-section { padding: 5rem 0 1rem; }
.admin-section-heading { margin-bottom: 1.5rem; }
.admin-section-heading > p { max-width: 45ch; text-align: right; }
.admin-members-grid { display: grid; grid-template-columns: .72fr 1.28fr; gap: 1rem; align-items: start; }
.admin-list, .admin-editor, .crm-card { border: 1px solid var(--border); border-radius: 16px; background: rgba(18,29,52,.7); }
.admin-list { overflow: hidden; }
.admin-list-item { display: flex; justify-content: space-between; gap: .8rem; align-items: center; padding: 1rem; border-bottom: 1px solid var(--border); }
.admin-list-item:last-child { border-bottom: 0; }
.admin-list-item strong, .admin-list-item span { display: block; }
.admin-list-item span { margin-top: .2rem; color: var(--muted); font-size: .7rem; }
.admin-row-actions { display: flex; align-items: center; gap: .55rem; }
.admin-link-danger { color: #e98a91; }
.admin-editor { padding: 1.2rem; display: grid; gap: 1rem; }
.admin-editor-top { display: flex; justify-content: space-between; }
.admin-editor .row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.position-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; border: 1px solid var(--border); border-radius: 12px; padding: .8rem; }
.position-fields legend { padding: 0 .4rem; color: var(--muted); font-size: .75rem; }
.admin-check { display: flex; align-items: center; gap: .6rem; color: var(--text); }
.admin-check input { accent-color: var(--primary); }
.admin-empty { padding: 1rem; }
.crm-toolbar { display: grid; grid-template-columns: 1fr 240px; gap: 1rem; margin-bottom: 1rem; }
.crm-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.crm-card { padding: 1rem; display: grid; gap: .7rem; border-top: 2px solid var(--primary); }
.crm-card.crm-join { border-top-color: var(--secondary); }
.crm-card-top { display: flex; justify-content: space-between; color: var(--muted); font: .63rem "JetBrains Mono", monospace; text-transform: uppercase; }
.crm-card h3, .crm-card p { margin: 0; }
.crm-card .crm-contact { font-size: .7rem; overflow-wrap: anywhere; }
.crm-card .crm-message { font-size: .82rem; color: #c2cbe1; }
.crm-card select, .crm-card textarea { width: 100%; }
.crm-card textarea { min-height: 70px; }
.crm-delete { justify-self: start; padding: .2rem 0; }
.admin-status { position: fixed; right: 1rem; bottom: 1rem; z-index: 80; max-width: min(420px, calc(100% - 2rem)); margin: 0; padding: .8rem 1rem; border-radius: 10px; background: #101b33; border: 1px solid var(--border); color: var(--muted); box-shadow: var(--shadow); }
.admin-status:empty { display: none; }
.admin-status.is-error { border-color: rgba(239, 110, 117, .5); color: #ffb3b8; }
.admin-status.is-success { border-color: rgba(57, 198, 157, .5); color: #80e4c6; }

.intent-switch { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; margin: 0 0 1rem; padding: 0; border: 0; min-width: 0; }
.intent-option { position: relative; }
.intent-option input { position: absolute; opacity: 0; pointer-events: none; }
.intent-option span { display: block; padding: .8rem; border: 1px solid var(--border); border-radius: 10px; color: var(--muted); text-align: center; font-weight: 700; cursor: pointer; transition: color .25s, border-color .25s, background .25s, transform .25s; }
.intent-option input:checked + span { color: var(--text); border-color: rgba(127,140,255,.6); background: rgba(108,125,255,.12); }
.intent-option input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.intent-option span:active { transform: scale(.98); }
.network-entry-strip { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: rgba(7,13,28,.8); }
.network-entry-inner { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center; padding-top: 2.2rem; padding-bottom: 2.2rem; }
.network-entry-inner h2 { margin-top: .3rem; max-width: 24ch; }
.network-entry-actions { display: flex; gap: .6rem; }

@keyframes networkPulse { 50% { opacity: .55; transform: scale(.8); } }
@keyframes graphLine { to { stroke-dashoffset: -24; } }
@keyframes openNode { 50% { transform: scale(1.045); opacity: .4; } }
@keyframes graphNodeFade { from { opacity: 0; } }
@keyframes graphCoreIn { from { opacity: 0; } }
@keyframes popoverIn { from { opacity: 0; transform: translate(-50%, calc(-100% - 58px)) scale(.96); } }

@media (max-width: 1000px) {
  .network-intro, .manifesto-hero-grid, .network-join-grid { grid-template-columns: 1fr; }
  .network-intro-aside { max-width: 540px; }
  .admin-members-grid { grid-template-columns: 1fr; }
  .crm-board { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .member-detail-grid { grid-template-columns: 1fr; }
  .member-detail-grid section, .member-detail-grid section + section { padding: 1.5rem 0; border-right: 0; border-bottom: 1px solid var(--border); }
}

@media (max-width: 760px) {
  .graph-toolbar, .admin-title-row, .admin-section-heading { align-items: stretch; flex-direction: column; }
  .graph-legend { white-space: normal; }
  .competency-graph { height: 540px; border-radius: 20px; }
  .graph-canvas { width: 100%; max-width: none; transform: none; }
  .graph-zone-title { font-size: 13px; }
  .graph-zone-description { font-size: 11px; }
  .graph-node-title { font-size: 12px; }
  .graph-node-subtitle { font-size: 10px; }
  .graph-hint { max-width: 180px; line-height: 1.5; }
  .graph-popover { display: none; }
  .manifesto-layout { grid-template-columns: 1fr; }
  .manifesto-index { position: static; display: flex; flex-wrap: wrap; }
  .manifesto-index span { width: 100%; }
  .member-profile-main { grid-template-columns: 1fr; }
  .member-avatar { order: -1; max-width: 320px; }
  .admin-workspace { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); flex-direction: row; align-items: center; gap: 1rem; overflow-x: auto; }
  .admin-sidebar nav { display: flex; margin: 0; }
  .admin-logout { margin: 0 0 0 auto; }
  .admin-content { padding: 1.2rem; }
  .admin-stats { grid-template-columns: 1fr; }
  .admin-stats article, .admin-stats article:first-child { padding: 1rem 0; border-right: 0; border-bottom: 1px solid var(--border); }
  .admin-editor .row, .crm-toolbar, .crm-board { grid-template-columns: 1fr; }
  .admin-section-heading > p { text-align: left; }
  .network-entry-inner { grid-template-columns: 1fr; }
  .network-entry-actions { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .network-live i, .graph-edge, .graph-node-svg, .graph-node-halo { animation: none !important; }
  .graph-viewport { transition: none; }
}
