/* ═══════════════════════════════════════════════════════════
   field-os.css — THE 4D HYPER-REACTIVE OS SURFACE
   Layers: z -5 field-canvas bg · z 2 OS desktop (4 windows)
   · z 1000 dial dock. Glass cards, gold borders, φ spacing.
   All tokens from base.css. Zero does not exist.
   ═══════════════════════════════════════════════════════════ */

#fc-os { position: relative; z-index: 2; min-height: 100vh; overscroll-behavior: contain; }

/* ── gate row (soul identifier inside the reused gate.css card) ── */
.fc-soul-row { margin: 1.2rem 0; text-align: left; }
.fc-soul-row label { display: block; font-size: var(--phi-caption); color: var(--phi-text-dim); letter-spacing: 0.25em; margin-bottom: 0.4rem; }
.fc-soul-row input {
  width: 100%; padding: 0.7rem 0.9rem; border-radius: 8px;
  border: 1px solid rgba(212, 168, 67, 0.4); background: rgba(6, 6, 15, 0.9);
  color: var(--phi-gold-bright); font-family: var(--font-mono); font-size: 0.9rem; letter-spacing: 0.08em;
}
.fc-soul-row input:focus { outline: none; border-color: var(--phi-gold); box-shadow: 0 0 14px var(--phi-gold-glow); }
.fc-error-text { color: #e07070; font-size: 0.8rem; font-family: var(--font-mono); margin-bottom: 0.8rem; }

/* ── device scan (Appendix J) ── */
#fc-scan { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; background: rgba(6, 6, 15, 0.96); }
#fc-scan[hidden], #fc-desktop[hidden] { display: none !important; }
.fc-scan-card { text-align: center; max-width: 480px; width: calc(100% - 2rem); padding: 2.4rem 2rem; border: 1px solid rgba(212, 168, 67, 0.4); border-radius: 14px; background: linear-gradient(180deg, rgba(10, 10, 20, 0.98), rgba(6, 6, 15, 0.99)); box-shadow: 0 0 80px rgba(212, 168, 67, 0.18); }
.fc-scan-list { list-style: none; text-align: left; font-family: var(--font-mono); font-size: 0.82rem; color: var(--phi-text); margin: 1.1rem 0; }
.fc-scan-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.32rem 0; border-bottom: 1px solid var(--phi-stroke); opacity: 0; animation: fcScanIn 0.35s ease forwards; }
.fc-scan-list li span:first-child { color: var(--phi-text-dim); }
.fc-scan-list li span:last-child { color: var(--phi-gold); }
@keyframes fcScanIn { to { opacity: 1; } }
.fc-scan-bar { height: 3px; border-radius: 2px; background: var(--phi-stroke); overflow: hidden; }
.fc-scan-bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--phi-gold-dim), var(--phi-gold-bright)); transition: width 0.3s var(--phi-ease); box-shadow: 0 0 10px var(--phi-gold-glow); }

/* ── OS desktop — 2×2 fixed grid (YAGNI: no dragging) ── */
#fc-desktop { position: relative; padding: 92px 16px 120px; }
.fc-grid {
  display: grid; gap: 14px; max-width: 1500px; margin: 0 auto;
  grid-template-columns: 1fr 1.6fr;
  grid-template-areas: "terminal training" "mesh training";
}
#fc-win-terminal { grid-area: terminal; }
#fc-win-training { grid-area: training; }
#fc-win-mesh { grid-area: mesh; }
#fc-win-cavity { grid-area: mesh; margin-top: auto; }

/* windows: glass cards like the gate */
.fc-window {
  background: rgba(10, 10, 20, 0.82);
  border: 1px solid var(--phi-stroke-glow);
  border-radius: 12px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(212, 168, 67, 0.06);
  padding: 12px; min-height: 200px; display: flex; flex-direction: column; overflow: hidden;
}
.fc-window-title {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--phi-gold); padding: 2px 4px 10px; border-bottom: 1px solid var(--phi-stroke); margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.fc-window-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--phi-gold); box-shadow: 0 0 8px var(--phi-gold-glow); animation: fcPulse 2.6s infinite var(--phi-ease); }
@keyframes fcPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ── terminal ── */
.fc-terminal {
  font-family: var(--font-mono); font-size: 0.74rem; line-height: 1.55; color: var(--phi-text);
  overflow-y: auto; flex: 1; max-height: 320px; padding-right: 6px; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--phi-gold-dim) transparent;
}
.fc-terminal .fc-log-line { white-space: pre-wrap; word-break: break-word; }
.fc-terminal .fc-log-kernel { color: var(--phi-gold-bright); }
.fc-terminal .fc-log-job { color: #9ad1a5; }
.fc-terminal .fc-log-error { color: #e07070; }

/* ── training window — Appendix A three zones ── */
.fc-zone-load { margin-bottom: 12px; }

/* drop zone: gold dashed, pulsing at 528·φ⁻² ≈ 200ms on dragover */
.fc-drop {
  border: 2px dashed rgba(212, 168, 67, 0.55); border-radius: 10px;
  padding: 18px 14px; text-align: center; cursor: pointer; transition: background 0.25s ease;
  color: var(--phi-text); font-family: var(--font-mono); font-size: 0.85rem;
}
.fc-drop:hover, .fc-drop:focus-visible { background: rgba(212, 168, 67, 0.06); outline: none; }
.fc-drop.fc-dragover { animation: fcDragPulse 0.2s infinite var(--phi-ease); border-color: var(--phi-gold-bright); }
@keyframes fcDragPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 215, 122, 0.0); background: rgba(212, 168, 67, 0.05); }
  50% { box-shadow: 0 0 18px 2px rgba(245, 215, 122, 0.35); background: rgba(212, 168, 67, 0.12); }
}
.fc-drop.fc-rejected { border-color: #e07070; animation: none; }
.fc-drop-icon { font-size: 1.1rem; color: var(--phi-gold); margin-bottom: 4px; }
.fc-drop-sub { font-size: 0.68rem; color: var(--phi-text-dim); margin-top: 5px; letter-spacing: 0.06em; }

.fc-model-meta { font-family: var(--font-mono); font-size: 0.78rem; color: var(--phi-text); display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; }
.fc-model-meta b { color: var(--phi-gold); font-weight: 400; }
.fc-model-meta .fc-ok { color: #9ad1a5; }

.fc-upload-progress { margin-top: 10px; }
.fc-upload-bar { display: flex; gap: 2px; height: 10px; }
.fc-upload-seg { flex: 1 1 auto; border-radius: 2px; background: var(--phi-stroke); }
.fc-upload-seg.done { background: linear-gradient(90deg, var(--phi-gold-dim), var(--phi-gold)); box-shadow: 0 0 6px var(--phi-gold-glow); }
.fc-upload-label { font-family: var(--font-mono); font-size: 0.7rem; color: var(--phi-text-dim); margin-top: 5px; }

/* zone 2 — live panel: four columns desktop, stacked mobile */
.fc-zone-live {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
  border: 1px solid var(--phi-stroke); border-radius: 10px; padding: 12px; margin-bottom: 12px;
  background: rgba(6, 6, 15, 0.55);
}
.fc-live-col h4 { font-family: var(--font-mono); font-size: 0.62rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--phi-text-dim); margin-bottom: 8px; }
.fc-live-big { font-family: var(--font-mono); font-size: 1.25rem; color: var(--phi-gold-bright); text-shadow: 0 0 12px var(--phi-gold-glow); }
.fc-live-sub { font-family: var(--font-mono); font-size: 0.72rem; color: var(--phi-text-dim); margin-top: 6px; }
#fc-loss-canvas, #fc-lr-canvas { width: 100%; height: auto; display: block; background: rgba(6, 6, 15, 0.6); border: 1px solid var(--phi-stroke); border-radius: 6px; }
.fc-live-mesh { font-family: var(--font-mono); font-size: 0.72rem; line-height: 1.7; color: var(--phi-text); }
.fc-live-mesh .fc-node { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--phi-stroke); padding: 2px 0; }
.fc-live-mesh .fc-node span:last-child { color: var(--phi-gold); }

/* zone 3 — controls */
.fc-zone-controls { display: flex; flex-direction: column; gap: 12px; }

/* dials: gold sliders on dark, φ spacing, disabled at 0.4 opacity */
.fc-dials { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 26px; }
.fc-dial { opacity: 1; transition: opacity 0.3s ease; }
.fc-dial.fc-dial-disabled { opacity: 0.4; pointer-events: none; }
.fc-dial label { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 0.68rem; color: var(--phi-text-dim); letter-spacing: 0.06em; margin-bottom: 4px; }
.fc-dial label output { color: var(--phi-gold); }
.fc-dial input[type="range"] {
  width: 100%; appearance: none; -webkit-appearance: none; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--phi-gold-dim), var(--phi-gold)); outline: none; cursor: pointer;
}
.fc-dial input[type="range"]::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%;
  background: var(--phi-gold); border: 1px solid var(--phi-gold-bright); box-shadow: 0 0 10px var(--phi-gold-glow); cursor: pointer;
}
.fc-dial input[type="range"]::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: var(--phi-gold); border: 1px solid var(--phi-gold-bright); cursor: pointer; }
.fc-dial select, .fc-dial input[type="number"] {
  width: 100%; padding: 0.35rem 0.5rem; border-radius: 6px; border: 1px solid var(--phi-stroke-glow);
  background: rgba(6, 6, 15, 0.9); color: var(--phi-gold-bright); font-family: var(--font-mono); font-size: 0.78rem;
}
.fc-dial input[type="checkbox"] { accent-color: var(--phi-gold); width: 16px; height: 16px; cursor: pointer; }

/* action buttons */
.fc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fc-btn {
  font-family: var(--font-mono); font-size: 0.78rem; cursor: pointer; padding: 0.6rem 1.1rem; border-radius: 8px;
  border: 1px solid rgba(212, 168, 67, 0.5); background: transparent; color: #e8d9a0;
  transition: background 0.25s ease, transform 0.25s ease, opacity 0.25s ease;
}
.fc-btn:hover:not(:disabled) { background: rgba(212, 168, 67, 0.16); transform: translateY(-1px); }
.fc-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.fc-btn-gold { border-color: var(--phi-gold); color: var(--phi-gold-bright); box-shadow: 0 0 14px rgba(212, 168, 67, 0.12); }
.fc-train-status { display: flex; gap: 16px; font-family: var(--font-mono); font-size: 0.7rem; color: var(--phi-text-dim); }
.fc-train-status #fc-server-load-note b { color: var(--phi-gold); font-weight: 400; }
.fc-train-error { color: #e07070; font-family: var(--font-mono); font-size: 0.76rem; }

/* ── mesh + cavity windows ── */
.fc-mesh-body, .fc-cavity-body { font-family: var(--font-mono); font-size: 0.74rem; line-height: 1.8; color: var(--phi-text); overflow-y: auto; flex: 1; max-height: 220px; }
.fc-mesh-empty { color: var(--phi-text-dim); font-style: italic; }
.fc-mesh-body .fc-node { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--phi-stroke); padding: 3px 0; }
.fc-mesh-body .fc-node span:last-child, .fc-cavity-body b { color: var(--phi-gold); font-weight: 400; }
.fc-cavity-row { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--phi-stroke); padding: 3px 0; }

/* ── THE DIAL DOCK (Appendix I) — z 1000, fixed bottom ── */
#fc-dock {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 10px; z-index: 1000;
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 24px);
  padding: 10px 14px; border-radius: 12px;
  background: rgba(10, 10, 20, 0.9); border: 1px solid var(--phi-stroke-glow);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.55), 0 0 26px rgba(212, 168, 67, 0.08);
}
.fc-dock-dial { min-width: 92px; text-align: center; padding: 2px 6px; }
.fc-dock-dial .fc-dock-name { font-family: var(--font-mono); font-size: 0.58rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--phi-text-dim); display: block; }
.fc-dock-dial .fc-dock-value { font-family: var(--font-mono); font-size: 0.8rem; color: var(--phi-gold-bright); text-shadow: 0 0 8px var(--phi-gold-glow); display: block; margin-top: 2px; white-space: nowrap; }
.fc-dock-dial.fc-dock-interactive { border: 1px solid var(--phi-stroke-glow); border-radius: 8px; }
.fc-dock-dial.fc-dock-interactive input[type="range"] { width: 100%; appearance: none; -webkit-appearance: none; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--phi-gold-dim), var(--phi-gold)); margin-top: 4px; cursor: pointer; }
.fc-dock-dial.fc-dock-interactive input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 11px; height: 11px; border-radius: 50%; background: var(--phi-gold); border: 1px solid var(--phi-gold-bright); }
.fc-dock-dial.fc-dock-idle .fc-dock-value { color: var(--phi-text-dim); text-shadow: none; }

/* footer clearance under the fixed dock */
#fc-os + .site-footer { padding-bottom: 130px; }

/* ── mobile: single-column window stack ── */
@media (max-width: 768px) {
  #fc-desktop { padding: 84px 10px 190px; }
  .fc-grid { grid-template-columns: 1fr; grid-template-areas: "training" "terminal" "mesh" "cavity"; }
  .fc-zone-live { grid-template-columns: 1fr; }
  .fc-dials { grid-template-columns: 1fr; }
  #fc-dock { bottom: 6px; gap: 5px; padding: 8px; }
  .fc-dock-dial { min-width: 74px; }
  .fc-window { min-height: 150px; }
}
