/* Colours come from /theme.css: --bg, --fg, --accent, --danger */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font: 13px "JetBrainsMono Nerd Font Propo", "JetBrains Mono", ui-monospace, monospace;
}

/* Popup on the desktop (?view=popup, bin/notenet-view): rounded accent border.
   The radius must equal the picom corner-radius of the notenet-view rule (14);
   translucency and blur are done by picom. */
html.popup body {
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 14px;
}

#graph {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

.link {
  stroke: var(--fg);
  stroke-opacity: 0.25;
  stroke-width: 1.5;
}

.node { cursor: pointer; }

.node circle {
  fill: var(--accent);
  stroke: var(--accent);
  stroke-width: 2;
}

/* done: hollow and dim */
.node.done circle { fill: var(--bg); stroke-opacity: 0.6; }
.node.done text { opacity: 0.45; text-decoration: line-through; }

.node.selected circle { stroke: var(--fg); stroke-width: 3; }
.node.target circle { stroke: var(--fg); stroke-dasharray: 3 2; }

.node text {
  fill: var(--fg);
  font-size: 12px;
  dominant-baseline: middle;
  pointer-events: none;
  paint-order: stroke;
  stroke: var(--bg);
  stroke-width: 3px;
}

/* login page of the hub */
body.login { display: flex; align-items: center; justify-content: center; }
#login { display: flex; flex-direction: column; gap: 8px; width: 260px; }
#login input {
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--fg) 25%, transparent);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
}
#login input:focus { outline: 1px solid var(--accent); }
#login button { padding: 8px; }
#message { min-height: 16px; color: var(--danger); font-size: 12px; }

#logout { position: fixed; top: 8px; left: 12px; font-size: 11px; opacity: 0.6; }
#logout[hidden] { display: none; }

#hint, #status {
  position: fixed;
  left: 12px;
  opacity: 0.45;
  font-size: 11px;
  pointer-events: none;
}
#hint { bottom: 10px; }
#status { top: 10px; left: 50%; transform: translateX(-50%); }
#status.error { color: var(--danger); opacity: 1; }

#panel {
  position: fixed;
  top: 12px;
  right: 12px;
  bottom: 12px;
  width: 300px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 92%, var(--fg));
}
#panel[hidden] { display: none; }

#panel input[type="text"], #panel textarea {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid color-mix(in srgb, var(--fg) 20%, transparent);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
}
#panel input[type="text"] { font-weight: bold; }
#panel textarea { flex: 1; resize: none; }
#panel input:focus, #panel textarea:focus { outline: 1px solid var(--accent); }

.check { display: flex; align-items: center; gap: 6px; }
.check input { accent-color: var(--accent); }

.buttons { display: flex; flex-wrap: wrap; gap: 6px; }

button {
  padding: 4px 10px;
  border: 0;
  border-radius: 6px;
  background: color-mix(in srgb, var(--fg) 12%, transparent);
  color: var(--fg);
  font: inherit;
  cursor: pointer;
}
button:hover { background: color-mix(in srgb, var(--fg) 22%, transparent); }
button.danger { background: color-mix(in srgb, var(--danger) 80%, transparent); }
button[hidden] { display: none; }
