/* ============================================================
   SYSTEM UI — style1.css
   ============================================================ */

/* --- base --- */
body {
  font-family: "Zen Kaku Gothic New", sans-serif;
  background-color: #f2f2f2;
  color: #111;
  margin: 40px;
}

.container {
  max-width: 700px;
}

/* ============================================================
   NODE PAGE — contributor upload field
   ============================================================ */

.node-page {
  overflow: hidden;
  height: 100vh;
  margin: 0;
}

.node-page .container {
  position: fixed;
  top: 40px;
  left: 40px;
  z-index: 10;
}

.node-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.node-upload-wrap {
  position: absolute;
  pointer-events: all;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.node-upload-link {
  font-size: 13px;
  white-space: nowrap;
  color: #111;
  text-decoration: none;
  opacity: 0.6;
}

.node-upload-link:visited { color: #111; }
.node-upload-link:hover   { opacity: 1; text-decoration: none; }

.node-upload-delete {
  font-size: 11px;
  color: #111;
  opacity: 0;
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: opacity 0.15s;
  pointer-events: none;
}

.node-upload-wrap:hover .node-upload-delete {
  opacity: 0.35;
  pointer-events: all;
}

.node-upload-wrap:hover .node-upload-delete:hover {
  opacity: 1;
}

.node-upload-meta {
  font-size: 10px;
  color: #111;
  opacity: 0.3;
  margin-top: 2px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* ============================================================
   INDEX PAGE — full viewport network map
   ============================================================ */

.index-page {
  overflow: hidden;
  height: 100vh;
  margin: 0;
}

.index-page .container {
  position: fixed;
  top: 40px;
  left: 40px;
  max-width: none;
  width: auto;
  z-index: 10;
}

.index-system-links {
  margin-top: 4px;
}

.index-network {
  position: fixed;
  inset: 0;
  overflow: hidden;
  cursor: grab;
}

.index-network.panning {
  cursor: grabbing;
}

.network-canvas {
  position: absolute;
  width: 3000px;
  height: 2200px;
}

/* SVG network lines */
.network-svg {
  position: absolute;
  left: 0; top: 0;
  width: 3000px;
  height: 2200px;
  pointer-events: none;
}

.index-node {
  position: absolute;
  font-size: 13px;
  white-space: nowrap;
  color: #111;
  text-decoration: none;
  opacity: 0.25;
  transition: opacity 0.2s ease;
  animation: node-shimmer 6s ease-in-out infinite;
}

@keyframes node-shimmer {
  0%, 100% { opacity: 0.25; text-shadow: none; }
  50%       { opacity: 0.55; text-shadow: 0 0 8px rgba(0,0,0,0.15); }
}

.index-node--favorite {
  color: #c06070 !important;
}

/* favorites panel in container */
.index-favorites {
  margin-top: 2px;
}
.index-favorites-label {
  opacity: 0.4;
  font-size: 12px;
  margin-bottom: 4px;
}
.index-favorites-list a {
  display: block;
  font-size: 12px;
  color: #c06070;
  text-decoration: none;
  opacity: 0.7;
  line-height: 1.8;
}
.index-favorites-list a:hover {
  opacity: 1;
}

.index-node:visited {
  color: #111;
}

.index-node:hover {
  opacity: 1;
  text-decoration: none;
}

.index-node--visited {
  opacity: 0.85;
}

.index-node--hidden {
  opacity: 0.1;
}

.index-node--hidden:hover {
  opacity: 0.9;
}

/* --- typography --- */
.header {
  font-size: 22px;
  letter-spacing: 1px;
  margin-bottom: 20px;
  min-height: 1.4em;
}

.section {
  margin-bottom: 20px;
  min-height: 1.4em;
}

.small {
  font-size: 13px;
  opacity: 0.8;
}

p {
  min-height: 1.4em;
}

ul {
  list-style: none;
  padding-left: 0;
}

li {
  min-height: 1.4em;
}

/* --- links --- */
a {
  display: inline-block;
  color: blue;
  text-decoration: underline;
}

a:visited {
  color: purple;
}

.container a:hover,
.node-field a:hover {
  animation: flicker 0.6s ease-in-out;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.1; }
}

.blink {
  animation: blink 1s ease-in-out infinite;
}

@keyframes flicker {
  0%   { opacity: 1; }
  8%   { opacity: 0.7; }
  9%   { opacity: 1; }
  60%  { opacity: 1; }
  62%  { opacity: 0.2; }
  63%  { opacity: 1; }
  100% { opacity: 1; }
}

/* ============================================================
   WINDOWS 98 STYLE MODAL
   ============================================================ */

.win98-window {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  max-width: 92vw;
  background: #f2f2f2;
  border: 1px solid #555;
  z-index: 101;
  display: none;
  flex-direction: column;
  resize: both;
  overflow: hidden;
  font-family: "Zen Kaku Gothic New", sans-serif;
}

.win98-window.active {
  display: flex;
}

/* title bar */
.win98-titlebar {
  background: #111;
  color: #f2f2f2;
  padding: 6px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: move;
  user-select: none;
  flex-shrink: 0;
}

.win98-titlebar-title {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}

.win98-titlebar-title::before {
  content: '> ';
  opacity: 0.45;
}

/* close button */
.win98-close {
  background: none;
  border: none;
  color: #f2f2f2;
  opacity: 0.4;
  font-size: 12px;
  cursor: pointer;
  padding: 0 0 0 10px;
  font-family: "Zen Kaku Gothic New", sans-serif;
  line-height: 1;
  flex-shrink: 0;
}

.win98-close:hover {
  opacity: 1;
  background: none;
}

/* scrollable content area — equal padding all sides */
.win98-body {
  padding: 16px;
  overflow-y: auto;
  overflow-x: auto;
  flex-grow: 1;
  font-size: 13px;
  line-height: 1.8;
  color: #111;
  min-height: 0;
  box-sizing: border-box;
}

.win98-body p {
  margin-bottom: 1em;
  min-height: 0;
}

.win98-body h2 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 0.6em;
  letter-spacing: 0.05em;
}

/* images fill body exactly with equal margins on all sides */
.win98-body img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ============================================================
   UPLOAD WINDOW
   ============================================================ */

.win98-upload {
  display: grid !important;
  grid-template-rows: auto 1fr;
  min-height: 0 !important;
  max-height: none !important;
  min-width: 0 !important;
  max-width: none !important;
  width: 420px !important;
  overflow: hidden;
}

.win98-upload::after { display: none; }

.win98-upload-body {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  box-sizing: border-box;
}

/* type selector — shown first */
.win98-upload-types {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.win98-upload-type-btn {
  background: transparent;
  color: #111;
  border: none;
  border-bottom: 1px solid #ddd;
  font-family: "Zen Kaku Gothic New", sans-serif;
  font-size: 13px;
  padding: 6px 10px;
  cursor: pointer;
  text-align: left;
  letter-spacing: 0.02em;
}

.win98-upload-type-btn:hover { background: #111; color: #f2f2f2; }

/* form fields */
.win98-upload-label {
  font-size: 11px;
  opacity: 0.6;
  display: block;
  margin-bottom: 3px;
  letter-spacing: 0.05em;
}

.win98-upload-input,
.win98-upload-textarea {
  width: 100%;
  box-sizing: border-box;
  background: transparent;
  border: none;
  border-bottom: 1px solid #ccc;
  font-family: "Zen Kaku Gothic New", sans-serif;
  font-size: 13px;
  color: #111;
  padding: 4px 0;
  outline: none;
}

.win98-upload-textarea {
  resize: none;
  height: 60px;
  line-height: 1.6;
}

.win98-upload-input::placeholder,
.win98-upload-textarea::placeholder { color: #666; opacity: 1; }

.win98-upload-dropzone {
  border: 1px dashed #aaa;
  padding: 20px 16px;
  text-align: center;
  font-size: 12px;
  opacity: 0.6;
  cursor: pointer;
  transition: opacity 0.15s;
  position: relative;
}

.win98-upload-dropzone.dragover { opacity: 1; border-color: #999999; }

.win98-upload-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.win98-upload-filename {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 4px;
}

.win98-upload-back {
  font-size: 11px;
  opacity: 0.5;
  background: none;
  border: none;
  font-family: "Zen Kaku Gothic New", sans-serif;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.win98-upload-back:hover { opacity: 1; }

.win98-upload-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.win98-upload-submit {
  background: #111;
  color: #f2f2f2;
  border: none;
  font-family: "Zen Kaku Gothic New", sans-serif;
  font-size: 11px;
  padding: 4px 12px;
  cursor: pointer;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
}

.win98-upload-submit:hover { background: #333; }
.win98-editor-save:hover   { background: #333; }

.win98-upload-status {
  font-size: 11px;
  opacity: 0.6;
}

/* ============================================================
   TEXT EDITOR WINDOW
   ============================================================ */

.win98-editor {
  display: grid !important;
  grid-template-rows: auto auto auto 1fr auto;
  min-height: 0 !important;
  max-height: none !important;
  min-width: 0 !important;
  max-width: none !important;
  width: 560px !important;
  height: 480px !important;
}

.win98-editor::after { display: none; }

.win98-editor-titleinput {
  background: transparent;
  border: none;
  border-bottom: 1px solid #ccc;
  font-family: "Zen Kaku Gothic New", sans-serif;
  font-size: 13px;
  color: #111;
  padding: 8px 16px;
  width: 100%;
  box-sizing: border-box;
  outline: none;
}

.win98-editor-titleinput::placeholder { color: #666; opacity: 1; }

.win98-editor-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  border-bottom: 1px solid #ccc;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.win98-editor-btn {
  background: transparent;
  color: #111;
  border: 1px solid #ccc;
  min-width: 22px;
  height: 18px;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  font-family: "Zen Kaku Gothic New", sans-serif;
  white-space: nowrap;
}

.win98-editor-btn:hover  { background: #111; color: #f2f2f2; border-color: #111; }
.win98-editor-btn:active { background: #333; color: #f2f2f2; border-color: #333; }

.win98-editor-btn b { font-weight: 700; }
.win98-editor-btn i { font-style: italic; }
.win98-editor-btn u { text-decoration: underline; }

.win98-editor-sep {
  width: 1px;
  height: 14px;
  background: #ccc;
  margin: 0 4px;
}

.win98-editor-size {
  font-family: "Zen Kaku Gothic New", sans-serif;
  font-size: 10px;
  background: transparent;
  border: 1px solid #ccc;
  color: #111;
  padding: 0 2px;
  height: 18px;
  cursor: pointer;
  outline: none;
}

.win98-editor-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  outline: none;
  font-size: 13px;
  line-height: 1.8;
  color: #111;
  font-family: "Zen Kaku Gothic New", sans-serif;
  box-sizing: border-box;
}

.win98-editor-body:empty::before {
  content: attr(data-placeholder);
  color: #666;
  pointer-events: none;
}

.win98-editor-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 8px 0;
}

.win98-editor-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 6px 8px;
  border-top: 1px solid #ccc;
  gap: 6px;
  flex-shrink: 0;
}

.win98-editor-save {
  background: #111;
  color: #f2f2f2;
  border: none;
  font-family: "Zen Kaku Gothic New", sans-serif;
  font-size: 11px;
  padding: 3px 10px;
  cursor: pointer;
  letter-spacing: 0.05em;
}

.win98-editor-save:hover { background: #333; }

.win98-editor-status {
  font-size: 11px;
  opacity: 0.5;
}

/* ============================================================
   AUDIO PLAYER WINDOW
   ============================================================ */

.win98-audio {
  display: grid !important;
  grid-template-rows: auto 1fr;
  min-height: 0 !important;
  max-height: none !important;
  min-width: 0 !important;
  max-width: none !important;
  overflow: hidden;
}

/* hide the default ::after resize indicator — we use a custom handle */
.win98-audio::after {
  display: none;
}

.win98-audio-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* cover image fills all space above controls */
.win98-audio-cover {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #e8e8e8;
}

.win98-audio-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* bottom controls bar: timeline + play/pause */
.win98-audio-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  height: 36px;
  flex-shrink: 0;
  border-top: 1px solid #ccc;
  box-sizing: border-box;
}

/* timeline range input */
.win98-audio-timeline {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 2px;
  background: #999999;
  outline: none;
  cursor: pointer;
  border-radius: 0;
}

.win98-audio-timeline::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 8px;
  height: 8px;
  background: #999999;
  cursor: pointer;
  border-radius: 0;
}

.win98-audio-timeline::-moz-range-thumb {
  width: 8px;
  height: 8px;
  background: #999999;
  border: none;
  cursor: pointer;
  border-radius: 0;
}

/* play / pause button */
.win98-audio-playpause {
  background: transparent;
  color: #111;
  border: 1px solid #ccc;
  width: 22px;
  height: 18px;
  font-size: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-family: "Zen Kaku Gothic New", sans-serif;
  flex-shrink: 0;
  letter-spacing: -1px;
}

.win98-audio-playpause:hover {
  background: #111;
  color: #f2f2f2;
  border-color: #111;
}

/* ============================================================
   VIDEO PLAYER WINDOW
   ============================================================ */

.win98-video {
  display: grid !important;
  grid-template-rows: auto 1fr;
  min-height: 0 !important;
  max-height: none !important;
  min-width: 0 !important;
  max-width: none !important;
  overflow: hidden;
}

.win98-video::after {
  display: none;
}

.win98-video-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.win98-video-element {
  flex: 1;
  min-height: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}

/* 3D viewport window — canvas fills body, no padding */
.win98-3d {
  resize: both;
}

.win98-3d-body {
  padding: 0 !important;
  overflow: hidden !important;
}

.win98-3d-body canvas {
  display: block;
}

.win98-3d-loading {
  padding: 16px;
  font-size: 13px;
  opacity: 0.5;
}

/* ============================================================
   NIER LOADING ANIMATION
   ============================================================ */

@keyframes nier-scan {
  0%   { width: 0% }
  60%  { width: 100% }
  100% { width: 100% }
}

@keyframes nier-blink {
  0%, 100% { opacity: 1 }
  50%       { opacity: 0 }
}

@keyframes nier-flicker {
  0%, 95%, 100% { opacity: 1 }
  96%            { opacity: 0.2 }
  98%            { opacity: 0.6 }
}

.nier-loading {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 16px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #111;
  animation: nier-flicker 2.4s infinite;
}

.nier-loading-label {
  opacity: 0.5;
  text-transform: uppercase;
}

.nier-loading-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nier-loading-bar {
  flex: 1;
  height: 2px;
  background: #ddd;
  overflow: hidden;
}

.nier-loading-bar-fill {
  height: 100%;
  background: #999999;
  animation: nier-scan 1.6s ease-in-out infinite;
}

.nier-loading-pct {
  opacity: 0.4;
  min-width: 36px;
  text-align: right;
}

.nier-loading-cursor {
  animation: nier-blink 0.9s step-end infinite;
}

/* image windows use custom resize handle — hide the default indicator */
.win98-window-image::after { display: none; }

/* resize handle indicator for text windows */
.win98-window::after {
  content: '◢';
  position: sticky;
  bottom: 2px;
  left: calc(100% - 16px);
  font-size: 10px;
  opacity: 0.3;
  pointer-events: none;
  display: block;
  text-align: right;
  flex-shrink: 0;
}
/* ============================================================
   PAGE LOADER — full-screen NieR overlay on initial load
   ============================================================ */
.page-loader {
  position: fixed;
  inset: 0;
  background: #f2f2f2;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}
.page-loader.fade-out {
  opacity: 0;
  pointer-events: none;
}
.page-loader .nier-loading {
  padding: 0;
  min-width: 200px;
}

/* ============================================================
   INSPIRATIONS PANEL — collapsible per-upload context
   ============================================================ */
.inspirations-panel {
  border-top: 1px solid #e0e0e0;
  flex-shrink: 0;
}
.inspirations-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  font-size: 11px;
  letter-spacing: 0.06em;
  opacity: 0.5;
  cursor: pointer;
  user-select: none;
}
.inspirations-toggle:hover { opacity: 0.9; }
.inspirations-toggle-arrow { font-size: 9px; transition: transform 0.2s; }
.inspirations-panel.open .inspirations-toggle-arrow { transform: rotate(180deg); }
.inspirations-body {
  display: none;
  padding: 8px 10px;
  min-height: 60px;
  max-height: 200px;
  overflow-y: auto;
}
.inspirations-panel.open .inspirations-body { display: block; }
.inspirations-editor {
  width: 100%;
  min-height: 80px;
  outline: none;
  font-family: "Zen Kaku Gothic New", sans-serif;
  font-size: 12px;
  line-height: 1.7;
  color: #111;
  caret-color: #111;
}
.inspirations-editor:empty::before {
  content: attr(data-placeholder);
  opacity: 0.3;
  pointer-events: none;
}
.inspirations-toolbar {
  display: flex;
  gap: 4px;
  padding: 4px 0 6px;
  border-bottom: 1px solid #e8e8e8;
  margin-bottom: 6px;
}
.inspirations-toolbar button {
  background: none;
  border: 1px solid #ddd;
  font-size: 11px;
  padding: 1px 6px;
  cursor: pointer;
  font-family: "Zen Kaku Gothic New", sans-serif;
  color: #555;
}
.inspirations-toolbar button:hover { background: #f0f0f0; }
.inspirations-save {
  margin-top: 6px;
  font-size: 11px;
  background: #999999;
  color: #f2f2f2;
  border: none;
  padding: 3px 10px;
  cursor: pointer;
  font-family: "Zen Kaku Gothic New", sans-serif;
  letter-spacing: 0.05em;
}
.inspirations-view {
  font-size: 12px;
  line-height: 1.7;
  color: #333;
}

/* ============================================================
   ALL-FILES OVERLAY
   ============================================================ */

.node-all-files-toggle,
.node-support-link {
  position: fixed;
  left: 40px;
  background: transparent;
  border: none;
  outline: none;
  box-shadow: none;
  font-family: "Zen Kaku Gothic New", sans-serif;
  font-size: 12px;
  color: #111;
  opacity: 0.35;
  cursor: pointer;
  padding: 0;
  margin: 0;
  letter-spacing: 0.05em;
  z-index: 500;
  display: none;
  appearance: none;
  -webkit-appearance: none;
}

.node-all-files-toggle { bottom: 32px; }
.node-support-link     { bottom: 12px; }

.node-all-files-toggle:hover,
.node-support-link:hover { opacity: 1; }

.node-all-files-toggle:focus,
.node-support-link:focus { outline: none; box-shadow: none; }

.node-all-files {
  position: fixed;
  inset: 0;
  background: #f2f2f2;
  z-index: 400;
  display: none;
  align-items: flex-start;
  padding: 80px 40px 40px;
  box-sizing: border-box;
  opacity: 0;
  transition: opacity 0.2s ease;
  overflow-y: auto;
}

.node-all-files.open {
  opacity: 1;
}

.node-all-files-inner {
  display: flex;
  flex-direction: row;
  gap: 60px;
  flex-wrap: wrap;
}

.node-all-files-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
}

.node-all-files-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.35;
  margin-bottom: 4px;
}

.node-all-files-item {
  font-size: 13px;
  color: #111;
  text-decoration: none;
  opacity: 0.7;
  display: block;
  position: static !important;
  white-space: nowrap;
}

.node-all-files-item:hover {
  opacity: 1;
  text-decoration: none;
}

.index-flash {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: #f2f2f2;
  border: 1px solid #555;
  padding: 8px 18px;
  font-size: 11px;
  font-family: "Zen Kaku Gothic New", sans-serif;
  letter-spacing: 0.06em;
  z-index: 9000;
  pointer-events: none;
  white-space: nowrap;
}

/* ── online presence (index page only) ── */
.index-node--online::after {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  background: #5abf72;
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
  position: relative;
  top: -1px;
  animation: dot-pulse 2.4s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.7); }
}

/* ── network activity feed (index page only) ── */
.network-activity {
  position: fixed;
  bottom: 28px;
  right: 28px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  z-index: 800;
  pointer-events: none;
  max-width: 420px;
}

.activity-line {
  font-size: 10px;
  font-family: "Zen Kaku Gothic New", sans-serif;
  letter-spacing: 0.07em;
  color: #111;
  opacity: 0.45;
  white-space: nowrap;
  line-height: 1.5;
}

/* ============================================================
   MOBILE — terminal feed view (≤767px)
   ============================================================ */

@media (max-width: 767px) {

  /* ── base reset ── */
  body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
  }

  /* ── about / log pages (no body class) ── */
  body:not(.node-page):not(.index-page) .container {
    max-width: 100%;
    box-sizing: border-box;
    padding: 28px 22px 40px;
  }

  body:not(.node-page):not(.index-page) {
    background: #111;
    color: #f2f2f2;
  }

  body:not(.node-page):not(.index-page) a {
    color: #f2f2f2;
  }

  /* ── node page ── */
  .node-page {
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
    background: #111;
    color: #f2f2f2;
  }

  .node-page .container {
    position: static;
    top: auto;
    left: auto;
    padding: 28px 22px 16px;
    background: #111;
    border-bottom: 1px solid rgba(242,242,242,0.1);
    z-index: auto;
  }

  .node-page .header {
    color: #f2f2f2;
    font-size: 15px;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
  }

  .node-page .section.small {
    color: rgba(242,242,242,0.7);
    font-size: 11px;
    letter-spacing: 0.04em;
  }

  .node-page .section.small a {
    color: rgba(242,242,242,0.7);
    text-decoration: none;
  }

  /* hide layout/save controls on mobile — upload shown via floating btn */
  #node-save-layout-btn {
    display: none !important;
  }
  #node-upload-btn {
    display: none !important;
  }

  /* hide the desktop scattered field entirely */
  .node-field { display: none; }

  /* hide the all-files overlay toggle on mobile */
  .node-all-files-toggle,
  .node-support-link { display: none !important; }

  /* ── mobile upload FAB (own node only) ── */
  .mobile-upload-fab {
    position: fixed;
    bottom: 28px;
    right: 22px;
    z-index: 500;
    background: #f2f2f2;
    color: #111;
    border: none;
    font-family: "Zen Kaku Gothic New", sans-serif;
    font-size: 11px;
    letter-spacing: 0.08em;
    padding: 10px 18px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  /* upload window on mobile — full-width, scrollable */
  .win98-window {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    left: 12px !important;
    top: 12px !important;
    transform: none !important;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
  }

  /* ── mobile feed ── */
  .mobile-feed {
    padding: 0 0 100px;
  }

  .mobile-feed-item {
    display: flex;
    flex-direction: column;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(242,242,242,0.1);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-feed-item:active {
    background: rgba(242,242,242,0.05);
  }

  .mobile-feed-title {
    font-size: 13px;
    letter-spacing: 0.05em;
    color: #f2f2f2;
    opacity: 0.92;
    margin-bottom: 5px;
  }

  .mobile-feed-title::before {
    content: '> ';
    opacity: 0.35;
  }

  .mobile-feed-meta {
    font-size: 10px;
    letter-spacing: 0.06em;
    color: rgba(242,242,242,0.55);
    line-height: 1.7;
  }

  .mobile-feed-type {
    display: inline-block;
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(242,242,242,0.5);
    border: 1px solid rgba(242,242,242,0.25);
    padding: 1px 5px;
    margin-bottom: 6px;
    align-self: flex-start;
  }

  /* ── mobile add-to-constellation link ── */
  .mobile-const-btn {
    display: inline-block;
    font-size: 9px;
    letter-spacing: 0.07em;
    color: rgba(242,242,242,0.38);
    margin-top: 7px;
    position: relative;
    z-index: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  /* ── mobile node list (index page) ── */
  .mobile-node-list {
    padding: 0 0 60px;
  }

  .mobile-node-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 1px solid rgba(242,242,242,0.1);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-node-item:active {
    background: rgba(242,242,242,0.05);
  }

  .mobile-node-name {
    font-size: 13px;
    letter-spacing: 0.05em;
    color: rgba(242,242,242,0.85);
  }

  .mobile-node-name::before {
    content: '> ';
    color: rgba(242,242,242,0.3);
  }

  .mobile-node-status {
    font-size: 9px;
    letter-spacing: 0.08em;
    color: rgba(242,242,242,0.35);
    text-transform: uppercase;
  }

  .mobile-node-status.online {
    color: #5abf72;
  }

  /* index page on mobile — dark terminal */
  .index-page {
    background: #111;
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
  }

  .index-page .container {
    position: static;
    top: auto;
    left: auto;
    padding: 28px 22px 16px;
    background: #111;
    border-bottom: 1px solid rgba(242,242,242,0.1);
  }

  .index-page .header {
    color: #f2f2f2;
    font-size: 15px;
    letter-spacing: 0.06em;
  }

  .index-page .section.small,
  .index-page .section.small a,
  .index-page .section a {
    color: rgba(242,242,242,0.6);
    text-decoration: none;
  }

  /* hide desktop canvas on mobile */
  .index-network,
  .network-activity { display: none; }

  /* ── mobile media overlay ── */
  .mobile-overlay {
    position: fixed;
    inset: 0;
    background: #111;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .mobile-overlay-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(242,242,242,0.1);
  }

  .mobile-overlay-title {
    font-size: 11px;
    letter-spacing: 0.07em;
    color: rgba(242,242,242,0.65);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100vw - 80px);
  }

  .mobile-overlay-title::before {
    content: '> ';
    opacity: 0.4;
  }

  .mobile-overlay-close {
    background: none;
    border: none;
    color: rgba(242,242,242,0.45);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 0 4px 16px;
    line-height: 1;
    font-family: inherit;
    flex-shrink: 0;
  }

  .mobile-overlay-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-overlay-body img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    max-height: calc(100vh - 60px);
  }

  .mobile-overlay-body video {
    width: 100%;
    max-height: calc(100vh - 60px);
    display: block;
    background: #000;
  }

  .mobile-overlay-body audio {
    width: calc(100% - 44px);
    margin: 40px 22px;
  }

  .mobile-overlay-text {
    padding: 28px 22px;
    font-size: 13px;
    line-height: 1.7;
    color: rgba(242,242,242,0.75);
    letter-spacing: 0.03em;
    width: 100%;
    box-sizing: border-box;
    align-self: flex-start;
  }

  /* ── constellation page on mobile ── */
  .const-page-mobile {
    background: #111;
    min-height: 100vh;
    color: #f2f2f2;
  }

  /* hide the desktop constellation field */
  #const-field { display: none; }

  .const-mobile-header {
    padding: 28px 22px 16px;
    border-bottom: 1px solid rgba(242,242,242,0.1);
  }

  .const-mobile-header .header {
    color: #f2f2f2;
    font-size: 15px;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
  }

  .const-mobile-header a {
    color: rgba(242,242,242,0.4);
    text-decoration: none;
    font-size: 11px;
    letter-spacing: 0.04em;
  }

  .const-mobile-desc {
    font-size: 11px;
    color: rgba(242,242,242,0.38);
    letter-spacing: 0.04em;
    margin-top: 6px;
    line-height: 1.6;
  }

  #const-save-layout-btn { display: none !important; }

} /* end @media mobile */
