/* the maps of the contacts: the bar of the maps (sorted by clients) and the editor with the canvas, the tools and the panel */
/* One file for one part of the application: a change of that part touches only this file. */

.maps-bar {
  margin-bottom: 14px;
}
.maps-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.maps-head h3 {
  margin: 0;
}
.maps-group {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.maps-client {
  min-width: 140px;
  font-weight: 700;
  color: var(--muted);
  font-size: 13px;
}
.mp-new {
  margin-top: 12px;
}
.mp-new summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--accent);
}

/* the colours of the cards and of the lines (one set for both) */
.c-blue {
  --mc: #1f6fc9;
}
.c-green {
  --mc: #1e8e3e;
}
.c-orange {
  --mc: #e08a00;
}
.c-red {
  --mc: #c62828;
}
.c-purple {
  --mc: #6a4cc7;
}
.c-teal {
  --mc: #2e6170;
}
.c-grey {
  --mc: #7a7f87;
}
html[data-theme='dark'] .c-blue {
  --mc: #6aa8f0;
}
html[data-theme='dark'] .c-green {
  --mc: #5cc07a;
}
html[data-theme='dark'] .c-orange {
  --mc: #f0b050;
}
html[data-theme='dark'] .c-red {
  --mc: #ef8a84;
}
html[data-theme='dark'] .c-purple {
  --mc: #a690ee;
}
html[data-theme='dark'] .c-teal {
  --mc: #6fb0c4;
}
html[data-theme='dark'] .c-grey {
  --mc: #a4a9b0;
}

.map-editor {
  display: grid;
  gap: 10px;
}
.me-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
}
.me-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.me-group select {
  min-height: 34px;
  max-width: 220px;
}
.me-toolbar .btn.on,
.me-toolbar .btn[aria-pressed='true'] {
  background: color-mix(in srgb, var(--accent) 18%, var(--card));
  border-color: var(--accent);
}
.me-hint {
  margin: 0;
}
.me-hint.bad {
  color: #b3261e;
  font-weight: 700;
}
.me-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: start;
}
.map-edit {
  height: min(72vh, 760px);
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background-color: var(--card);
  overflow: hidden;
  touch-action: none;
}
.map-edit.bg-dots {
  background-image: radial-gradient(
    circle,
    color-mix(in srgb, var(--ink) 18%, transparent) 1.2px,
    transparent 1.4px
  );
  background-size: 22px 22px;
}
.map-edit.bg-grid {
  background-image:
    linear-gradient(color-mix(in srgb, var(--ink) 9%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--ink) 9%, transparent) 1px, transparent 1px);
  background-size: 28px 28px;
}
.map-edit svg {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  user-select: none;
}
.map-edit svg.connecting {
  cursor: crosshair;
}
.map-edit .node {
  cursor: pointer;
}
.map-edit .node .body {
  fill: var(--card);
  stroke: var(--mc, #1f6fc9);
  stroke-width: 2;
}
.map-edit .node.sel .body {
  stroke-width: 3.4;
  filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--mc, #1f6fc9) 40%, transparent));
}
.map-edit .node.from .body {
  stroke-dasharray: 6 4;
}
.map-edit .node .bar {
  fill: var(--mc, #1f6fc9);
}
.map-edit .node .badge {
  fill: color-mix(in srgb, var(--mc, #1f6fc9) 16%, transparent);
}
.map-edit .node .icon {
  color: var(--mc, #1f6fc9);
}
.map-edit .node .title {
  fill: var(--ink);
  font-size: 15px;
  font-weight: 700;
}
.map-edit .node .sub {
  fill: var(--muted);
  font-size: 12px;
}
.map-edit .node .state.s-planned {
  fill: #7a7f87;
}
.map-edit .node .state.s-doing {
  fill: #e08a00;
}
.map-edit .node .state.s-done {
  fill: #1e8e3e;
}
.map-edit .port {
  fill: var(--card);
  stroke: var(--mc, #1f6fc9);
  stroke-width: 2.4;
  cursor: crosshair;
}
.map-edit .edge {
  fill: none;
  stroke: var(--mc, #1f6fc9);
  stroke-width: 2.4;
  stroke-linecap: round;
}
.map-edit .edge.line-dashed {
  stroke-dasharray: 9 7;
}
.map-edit .edge.line-dotted {
  stroke-dasharray: 2 6;
}
.map-edit .edge.temp {
  stroke: var(--accent);
  stroke-dasharray: 6 5;
  pointer-events: none;
}
.map-edit .edge-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 16;
  cursor: pointer;
}
.map-edit .edge-g.sel .edge {
  stroke-width: 4;
}
.map-edit .arrow {
  fill: var(--mc, #1f6fc9);
}
.map-edit .particle {
  fill: var(--mc, #1f6fc9);
  stroke: var(--card);
  stroke-width: 1.4;
  pointer-events: none;
}
.map-edit .edge-label-bg {
  fill: var(--card);
  stroke: var(--line);
}
.map-edit .edge-label {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.me-panel {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.me-panel h3,
.me-panel h4 {
  margin: 0 0 4px;
}
.me-panel [hidden] {
  display: none;
}
.me-panel .f {
  margin: 0 0 8px;
}
.me-panel [data-panel] {
  display: grid;
  gap: 4px;
}
.me-panel [data-panel][hidden],
.me-panel [data-only][hidden],
.me-panel [data-for][hidden] {
  display: none;
}
.me-contact {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.me-person-add {
  border-top: 1px dashed var(--line);
  margin-top: 8px;
  padding-top: 8px;
}
.mp-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.mp-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid transparent;
  background: var(--mc);
  box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
  padding: 0;
}
.mp-swatch.on {
  border-color: var(--card);
  box-shadow: 0 0 0 3px var(--mc);
}

@media (max-width: 900px) {
  .me-body {
    grid-template-columns: 1fr;
  }
  .map-edit {
    height: 62vh;
    min-height: 340px;
  }
}
html.glass .map-edit {
  background-color: var(--g-pill, rgba(255, 255, 255, 0.5));
}
html.glass .me-panel {
  background: var(--g-pill, rgba(255, 255, 255, 0.5));
}
