:root {
  --bg: #0c0c14;
  --bg-elevated: #141422;
  --bg-card: #1a1a2e;
  --bg-card-hover: #1f1f36;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #e8e8f0;
  --text-muted: #8b8ba3;
  --accent: #ff6d5a;
  --accent-soft: rgba(255, 109, 90, 0.15);
  --accent-2: #7c6cff;
  --accent-3: #3ecf8e;
  --accent-4: #ffb347;
  --danger: #ff5c7a;
  --port: #64748b;
  --port-active: #ff6d5a;
  --grid-dot: rgba(255, 255, 255, 0.04);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --radius: 10px;
  --radius-sm: 6px;
  --font: "DM Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  overflow: hidden;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

.screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(124, 108, 255, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(255, 109, 90, 0.1), transparent),
    var(--bg);
}

.login-card {
  width: min(420px, 100%);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: var(--shadow);
}

.brand { text-align: center; margin-bottom: 1.75rem; }
.brand-icon {
  width: 52px; height: 52px;
  margin: 0 auto 1rem;
  display: grid; place-items: center;
  font-size: 1.5rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 14px;
}
.brand-icon.share { background: rgba(124, 108, 255, 0.15); color: var(--accent-2); }
.brand h1 { margin: 0 0 0.5rem; font-size: 1.5rem; font-weight: 700; }
.brand p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }

label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

input[type="text"], input[type="password"], input[type="number"], input[type="search"], select, textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  margin-bottom: 1rem;
  outline: none;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(124, 108, 255, 0.12);
}
input[type="search"] {
  appearance: none;
  -webkit-appearance: none;
}
input[type="search"]::-webkit-search-cancel-button {
  filter: invert(1);
  opacity: 0.55;
}

.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.55rem 1rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.14s ease, filter 0.18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }
.btn--primary {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), #ff8f7a);
  color: #fff;
}
.btn--primary:hover { filter: brightness(1.06); }
.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}
.btn--ghost:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.btn--icon { padding: 0.4rem 0.65rem; font-size: 1.1rem; }
.btn--sm { padding: 0.25rem 0.5rem; font-size: 1rem; }
.btn--danger { color: var(--danger); }

.form-error { color: var(--danger); font-size: 0.85rem; margin: 0; }

.app { display: flex; flex-direction: column; height: 100vh; }

.topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 1rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 20;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 0.5rem; }
.topbar-center { flex: 1; display: flex; align-items: center; justify-content: center; gap: 0.35rem; flex-wrap: wrap; }
.topbar-title-wrap { display: flex; align-items: center; gap: 0.5rem; }
.topbar-title {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  min-width: 180px;
}
.topbar-title:hover, .topbar-title:focus {
  border-color: var(--border);
  background: var(--bg-card);
}
.badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(255, 184, 71, 0.15);
  color: var(--accent-4);
}
.divider { width: 1px; height: 1.25rem; background: var(--border); margin: 0 0.25rem; }
.zoom-label { font-size: 0.8rem; color: var(--text-muted); min-width: 3rem; text-align: center; font-family: var(--mono); }
.save-status { font-size: 0.78rem; color: var(--text-muted); font-family: var(--mono); }

.main { flex: 1; min-height: 0; position: relative; }

.dashboard {
  height: 100%;
  overflow: auto;
  padding: 1.5rem 2rem 2rem;
}
.dashboard-actions { display: flex; gap: 0.65rem; align-items: center; flex-wrap: wrap; }
.search-input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  min-width: 200px;
  margin: 0;
}
.pw-row { display: flex; gap: 0.35rem; margin-bottom: 1rem; }
.pw-row input { margin: 0; flex: 1; }

.template-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 0.5rem; }
.template-card {
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}
.template-card:hover { border-color: var(--accent-2); transform: translateY(-1px); }
.template-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.template-card strong { display: block; font-size: 0.88rem; margin-bottom: 0.2rem; }
.template-card span { font-size: 0.75rem; color: var(--text-muted); }

.help-list { list-style: none; margin: 0; padding: 0; }
.help-list li { padding: 0.35rem 0; font-size: 0.88rem; }
.help-list kbd {
  display: inline-block;
  min-width: 1.5rem;
  padding: 0.1rem 0.35rem;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.75rem;
  margin-right: 0.35rem;
}

.search-nodes {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: min(280px, calc(100% - 2rem));
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  box-shadow: var(--shadow);
  z-index: 15;
}
.search-nodes-head { display: flex; gap: 0.35rem; align-items: center; margin-bottom: 0.35rem; }
.search-nodes input { margin: 0; font-size: 0.85rem; }
.search-nodes #btnCloseNodeSearch { flex-shrink: 0; }
.search-nodes ul { list-style: none; margin: 0; padding: 0; max-height: 200px; overflow: auto; }
.search-nodes li {
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.82rem;
}
.search-nodes li:hover { background: rgba(255,255,255,0.06); }

.wf-card-actions { position: absolute; top: 0.5rem; right: 0.5rem; display: flex; gap: 0.15rem; opacity: 0; transition: opacity 0.18s ease, transform 0.18s ease; transform: translateY(-2px); }
.wf-card:hover .wf-card-actions { opacity: 1; transform: translateY(0); }

.dashboard-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.dashboard-head h2 { margin: 0 0 0.35rem; font-size: 1.35rem; }
.muted { color: var(--text-muted); margin: 0; }

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.wf-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  cursor: pointer;
  animation: cardIn 0.24s ease both;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  overflow: hidden;
}
.wf-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}
.wf-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.25);
}
.wf-card h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.wf-card p { margin: 0 0 0.75rem; color: var(--text-muted); font-size: 0.85rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wf-card-meta { font-size: 0.75rem; color: var(--text-muted); font-family: var(--mono); display: flex; gap: 0.75rem; }
.empty-state { text-align: center; color: var(--text-muted); padding: 3rem; }

.editor { display: flex; height: 100%; }

.inspector {
  width: 0;
  flex-shrink: 0;
  background: var(--bg-elevated);
  border-right: 1px solid transparent;
  display: flex;
  flex-direction: column;
  z-index: 10;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateX(-18px);
  transition:
    width 0.28s cubic-bezier(.2,.8,.2,1),
    opacity 0.22s ease,
    transform 0.28s cubic-bezier(.2,.8,.2,1),
    border-color 0.22s ease;
  will-change: width, opacity, transform;
}
.inspector.is-open {
  width: 320px;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
  border-right-color: var(--border);
}
.inspector-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  min-width: 320px;
}
.inspector-head h3 { margin: 0; font-size: 0.9rem; }
.inspector-body {
  padding: 1rem;
  overflow: auto;
  flex: 1;
  min-width: 320px;
}
.inspector-body.is-refreshing {
  animation: inspectorContentIn 0.18s ease both;
}
.inspector-body textarea { min-height: 80px; resize: vertical; margin-bottom: 0.75rem; }
.color-row { display: flex; gap: 0.35rem; margin-bottom: 1rem; flex-wrap: wrap; }
.color-swatch {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}
.color-swatch.active { border-color: #fff; box-shadow: 0 0 0 2px var(--bg); }

.list-editor { margin-top: 0.5rem; }
.list-item-row {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
  align-items: center;
}
.list-item-row input { margin: 0; flex: 1; }
.list-item-row button { flex-shrink: 0; }

.outputs-editor { margin-top: 0.75rem; }
.output-row { display: flex; gap: 0.35rem; margin-bottom: 0.35rem; align-items: center; }
.output-row input { margin: 0; flex: 1; }

.canvas-wrap { flex: 1; position: relative; min-width: 0; background: var(--bg); }
.canvas-viewport {
  width: 100%; height: 100%;
  overflow: hidden;
  cursor: grab;
  background-color: var(--bg);
  background-image: radial-gradient(circle, var(--grid-dot) 1px, transparent 1px);
  background-size: 24px 24px;
}
.canvas-viewport.panning { cursor: grabbing; }
.canvas-viewport.connecting { cursor: crosshair; }

.canvas-world {
  position: absolute;
  left: 0; top: 0;
  transform-origin: 0 0;
  width: 40000px;
  height: 40000px;
}
.canvas-viewport:not(.panning) .canvas-world { transition: transform 0.18s cubic-bezier(.2,.8,.2,1); }

.edges-layer {
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  overflow: visible;
}
.edge-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 18;
  pointer-events: stroke;
  cursor: pointer;
}
.edge-path {
  fill: none;
  stroke: #5a5a78;
  stroke-width: 2.5;
  pointer-events: none;
  transition: stroke 0.16s ease, stroke-width 0.16s ease, opacity 0.16s ease;
}
.edge-path.selected {
  stroke: var(--accent);
  stroke-width: 3.5;
  filter: drop-shadow(0 0 7px rgba(255,109,90,0.45));
  animation: arrowPulse 1.4s ease-in-out infinite;
}
.edge-hit:hover + .edge-path { stroke: var(--accent-2); stroke-width: 3; }
.edge-label {
  fill: var(--text);
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 4px;
  font-size: 12px;
  font-weight: 700;
  text-anchor: middle;
  pointer-events: none;
}
.spline-point {
  fill: var(--accent-2);
  stroke: #fff;
  stroke-width: 2;
  cursor: grab;
  pointer-events: all;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.35));
  transition: r 0.14s ease, fill 0.14s ease;
}
.spline-point:hover {
  r: 9;
  fill: var(--accent);
}

.nodes-layer { position: absolute; inset: 0; }

.wf-node {
  position: absolute;
  width: 240px;
  min-height: 72px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
  cursor: default;
  user-select: none;
  transition: box-shadow 0.22s ease, border-color 0.22s ease, background 0.22s ease, opacity 0.16s ease, filter 0.16s ease, transform 0.18s ease;
}
.wf-node:hover:not(.dragging) { filter: brightness(1.07); transform: translateY(-3px); }
.wf-node.selected {
  box-shadow: 0 0 0 2px var(--accent-2), 0 0 24px rgba(124,108,255,0.35), 0 10px 32px rgba(0,0,0,0.45);
  border-color: rgba(124,108,255,0.65);
  animation: selectedGlow 1.8s ease-in-out infinite;
}
.wf-node.type-list { width: 260px; }
.wf-node.type-note {
  width: 200px;
  background: rgba(255, 184, 71, 0.08);
  border-color: rgba(255, 184, 71, 0.25);
}
.wf-node.dragging { opacity: 0.92; z-index: 100; filter: brightness(1.08); }
.node-resize {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 13px;
  height: 13px;
  border-right: 2px solid rgba(255,255,255,0.35);
  border-bottom: 2px solid rgba(255,255,255,0.35);
  cursor: nesw-resize;
  opacity: 0;
  transition: opacity 0.16s ease, border-color 0.16s ease;
}
.wf-node:hover .node-resize,
.wf-node.selected .node-resize { opacity: 1; }
.node-resize:hover { border-color: var(--accent); }

.node-accent {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  border-radius: var(--radius) 0 0 var(--radius);
}
.node-head {
  padding: 0.65rem 0.85rem 0.35rem 1rem;
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1.3;
}
.node-body {
  padding: 0 0.85rem 0.65rem 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}
.node-list {
  list-style: none;
  margin: 0;
  padding: 0 0.85rem 0.65rem 1rem;
}
.node-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.node-list li::before {
  content: "▸";
  color: var(--accent);
  flex-shrink: 0;
}

.node-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  margin: 0 0.75rem 0.75rem 1rem;
  padding: 0.22rem;
  background: rgba(255,255,255,0.045);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.node-toggle-option {
  border: none;
  border-radius: 999px;
  padding: 0.32rem 0.45rem;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.73rem;
  font-weight: 700;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, transform 0.14s ease, box-shadow 0.18s ease;
}
.node-toggle-option:hover:not(:disabled) { color: var(--text); transform: translateY(-1px); }
.node-toggle-option.active {
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: #fff;
  box-shadow: 0 4px 14px rgba(124,108,255,0.25);
}
.node-toggle-option:disabled {
  cursor: default;
  opacity: 0.8;
}

.toggle-editor { margin-top: 0.75rem; }
.toggle-editor-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}
.toggle-editor-row input,
.toggle-editor-row select {
  margin: 0;
}

.geometry-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.35rem;
  margin-bottom: 1rem;
}
.geometry-row input { margin: 0; }
#nodeScale {
  width: 100%;
  accent-color: var(--accent-2);
  margin-bottom: 0.75rem;
}
.inputs-editor { margin-top: 0.75rem; }
.input-row { display: flex; gap: 0.35rem; margin-bottom: 0.35rem; align-items: center; }
.input-row input { margin: 0; flex: 1; }
.input-row button { flex-shrink: 0; }

.spline-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.spline-list {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
}
.spline-list li {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}
.spline-list li:last-child { border-bottom: none; }
.spline-color {
  width: 34px !important;
  height: 28px;
  padding: 0;
  margin: 0;
  border-radius: var(--radius-sm);
}
.check-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.8rem;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.82rem;
}
.check-row input {
  width: auto;
  margin: 0;
}

.port {
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--port);
  cursor: crosshair;
  z-index: 5;
  transition: border-color 0.14s ease, transform 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
}
.port:hover, .port.highlight {
  border-color: var(--port-active);
  background: var(--accent-soft);
  transform: scale(1.15);
  box-shadow: 0 0 0 5px rgba(255,109,90,0.12);
}
.ports-in { position: absolute; left: -8px; top: 0; bottom: 0; width: 0; }
.port-in { left: 0; margin-left: -7px; }
.ports-out { position: absolute; right: -8px; top: 0; bottom: 0; width: 0; }
.port-out { right: 0; margin-right: -7px; }

.canvas-hint {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(12, 12, 20, 0.85);
  border: 1px solid var(--border);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  pointer-events: none;
}
.connect-banner {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(255,109,90,0.35);
  padding: 0.45rem 1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  animation: bannerIn 0.18s ease both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes bannerIn {
  from { opacity: 0; transform: translate(-50%, -6px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes inspectorContentIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes selectedGlow {
  0%, 100% { box-shadow: 0 0 0 2px var(--accent-2), 0 0 18px rgba(124,108,255,0.28), 0 10px 32px rgba(0,0,0,0.45); }
  50% { box-shadow: 0 0 0 2px var(--accent-2), 0 0 32px rgba(124,108,255,0.5), 0 10px 32px rgba(0,0,0,0.45); }
}

@keyframes arrowPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 100;
}
.modal {
  border: none;
  padding: 0;
  background: transparent;
  max-width: min(520px, calc(100vw - 2rem));
  width: 100%;
  color: var(--text);
}
.modal::backdrop { background: rgba(0,0,0,0.55); }
.modal-inner {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  max-height: min(85vh, 640px);
}
.modal-head, .modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border);
}
.modal-foot { border-bottom: none; border-top: 1px solid var(--border); justify-content: flex-end; gap: 0.5rem; }
.modal-head h3, .modal-body h4 { margin: 0; }
.modal-body { padding: 1rem 1.1rem; overflow: auto; flex: 1; }
.modal-body hr { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }

.share-list, .activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.share-list li, .activity-list li {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}
.share-list li:last-child, .activity-list li:last-child { border-bottom: none; }
.share-meta { color: var(--text-muted); font-size: 0.75rem; margin-top: 0.2rem; }
.activity-time { font-family: var(--mono); font-size: 0.72rem; color: var(--text-muted); }
.activity-actor { font-weight: 600; color: var(--accent-2); }

.viewer-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.viewer-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}
.viewer-list li:last-child { border-bottom: none; }
.viewer-list span {
  color: var(--text-muted);
  font-size: 0.8rem;
}
#viewerCount {
  display: inline-grid;
  place-items: center;
  min-width: 1.25rem;
  height: 1.25rem;
  margin-left: 0.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
}

.arrow-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.arrow-list-item {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
.arrow-list-item:last-child { border-bottom: none; }
.arrow-list-item.selected .arrow-jump {
  border-color: rgba(255, 109, 90, 0.55);
  background: var(--accent-soft);
}
.arrow-jump {
  flex: 1;
  min-width: 0;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.65rem;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.14s ease;
}
.arrow-jump:hover {
  border-color: var(--accent-2);
  transform: translateY(-1px);
}
.arrow-jump strong {
  display: block;
  font-size: 0.86rem;
}
.arrow-jump span {
  display: block;
  color: var(--text-muted);
  font-size: 0.76rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-row { display: flex; gap: 0.35rem; }
.copy-row input { margin: 0; flex: 1; font-size: 0.78rem; font-family: var(--mono); }
.share-pw-out { font-family: var(--mono); font-size: 0.85rem; color: var(--accent-3); }

@media (max-width: 768px) {
  .inspector {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    box-shadow: var(--shadow);
    max-width: 86vw;
  }
  .inspector.is-open { width: min(320px, 86vw); }
  .topbar-center { display: none; }
}
