/* Memory page (memory.js): tab Inzicht. Only tokens from style.css, so both themes work. */

#memory { overflow-y: auto; min-height: 0; padding: 24px 32px 32px; display: flex; flex-direction: column; gap: 16px; }
body.breed #memory { grid-column: 2; grid-row: 3 / 6; }
body:not(.breed) #memory { flex: 1; padding: 16px 12px 24px; }
body.memorypage #overview { display: none !important; }
#memoryBtn[aria-pressed="true"] { background: var(--s2); color: var(--text); }
#memory[hidden], .memtab[hidden] { display: none; }
.memtabs button[aria-pressed="true"] { background: var(--s3); color: var(--text); }
#memRefresh[hidden] { display: none; }
#memory .ihead h1 { margin: 0; }

.memtab { display: grid; gap: 16px; align-content: start; min-width: 0; }
.memstatus { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 16px; line-height: 22px; }
.memstatus.fout b { color: var(--red-ink); }
.memstatus.let_op b { color: var(--warn); }
.memfout { margin: 0; padding: 10px 14px; border: 1px solid var(--red-ring); border-radius: var(--r-2); background: var(--red-wash); color: var(--red-ink); font-size: 13px; }
.memleeg { padding: 14px 16px; border: 1px dashed var(--line-2); border-radius: var(--r-3); }
.memleeg p { margin: 6px 0 0; color: var(--dim); font: 400 13px/19px var(--mono); overflow-wrap: anywhere; }

.memblok { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--s1); min-width: 0; }
.memblok h2 { margin: 0 0 10px; font: 700 15px/22px var(--sans); }
.memblok h3 { margin: 16px 0 6px; color: var(--faint); font: 700 11px/16px var(--sans); letter-spacing: .08em; text-transform: uppercase; }
.memlijst { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.memlijst li { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 13px; line-height: 18px; }
.membron, .mempad, .memmap { font-family: var(--mono); }
.membron { flex: none; min-width: 150px; }
.memnaam { flex: none; min-width: 150px; font-weight: 600; }
.memzin { flex: 1; min-width: 0; color: var(--dim); overflow-wrap: anywhere; }
.mempad { flex: 1; min-width: 0; color: var(--dim); font-size: 12px; overflow-wrap: anywhere; }
.memgetal { flex: none; margin-left: auto; color: var(--dim); font: 400 12px/16px var(--mono); white-space: nowrap; }

.memdot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--l-off); }
.memdot.ok { background: var(--ok); }
.memdot.let_op { background: var(--l-orange); }
.memdot.fout { background: var(--red-ink); }
.memdot.ontbreekt { background: var(--l-off); }

.memspark { flex: none; display: block; }
.memspark rect { fill: var(--l-blue); }

.membalken li { gap: 12px; }
.memmap { flex: none; width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.membalk { flex: 1; min-width: 40px; height: 8px; border-radius: 4px; background: var(--s3); overflow: hidden; }
.membalk i { display: block; height: 100%; min-width: 2px; border-radius: 4px; background: var(--l-blue); }

@media (max-width: 700px) {
  .memlijst li { flex-wrap: wrap; }
  .membron, .memnaam { min-width: 0; }
  .memgetal { margin-left: 20px; }
  .mempad { flex-basis: 100%; }
  .memmap { width: 90px; }
}

/* ---------- the map of the memory: one line through the layers, each layer a zone ---------- */
.memkaart { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
.mzones { position: relative; list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
/* the line: 6px, neutral (it is no session), from the first stop to the last */
.mzones::before { content: ""; position: absolute; left: 19px; top: 22px; bottom: 22px; width: 6px; border-radius: 3px; background: var(--dim); }
.mzone { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: start; }
.mstop { position: relative; z-index: 1; justify-self: center; margin-top: 14px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--text); box-shadow: 0 0 0 3px var(--bg); }
.mend .mstop { width: 20px; height: 20px; margin-top: 10px; background: var(--bg); border: 3.5px solid var(--text); box-shadow: 0 0 0 3px var(--bg); box-sizing: border-box; }
.mzbody { min-width: 0; padding: 12px 16px; border-radius: var(--r-3); background: color-mix(in srgb, var(--z) var(--zone-wash), transparent); }
.mend .mzbody { background: none; padding: 12px 4px; }
.mzhead { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mzhead b { font: 700 15px/22px var(--sans); }
.mzone:not(.mend) .mzhead b::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 3px; background: var(--z); vertical-align: 0; }
.mzrole { color: var(--dim); font-size: 13px; }
.mznums { margin-left: auto; color: var(--dim); font: 400 12px/16px var(--mono); white-space: nowrap; }
.mzline { margin: 6px 0 0; color: var(--dim); font-size: 13px; line-height: 19px; overflow-wrap: anywhere; }
.mzline code { font: 400 12px var(--mono); color: var(--dim); }
.mzsrc { font: 600 12px var(--mono); color: var(--text); }
.mzspark { display: flex; align-items: center; gap: 10px; margin-top: 8px; color: var(--dim); font-size: 13px; }
.mzspark .memgetal { margin-left: 0; }
.mzone .memspark rect, .mzone .membalk i { fill: var(--z); background: var(--z); }
.mzone .membalken { margin-top: 10px; }
.memuitleg { position: sticky; top: 0; padding: 4px 0 0; }
.memuitleg h2 { margin: 0 0 12px; font: 700 15px/22px var(--sans); }
.memuitleg ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.memuitleg li b { display: flex; align-items: center; gap: 8px; font: 600 14px/20px var(--sans); }
.memuitleg li b::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--z); flex: none; }
.memuitleg li p { margin: 3px 0 0 18px; color: var(--dim); font-size: 13px; line-height: 20px; max-width: 46ch; }
@media (max-width: 1099.98px) {
  .memkaart { grid-template-columns: minmax(0, 1fr); }
  .memuitleg { position: static; }
}
@media (max-width: 700px) {
  .mzhead { flex-wrap: wrap; }
  .mznums { margin-left: 0; flex-basis: 100%; }
}

/* Tab Mindmap (mindmap.js) */
#memMindmap .memfout button { margin-left: 8px; font: inherit; }
.mmwrap { position: relative; height: clamp(360px, 72vh, 820px); border: 1px solid var(--line); border-radius: var(--r-3); background: var(--s1); overflow: hidden; }
.mmcanvas { display: block; width: 100%; height: 100%; cursor: grab; }
.mmbar { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; pointer-events: none; }
.mmbar > * { pointer-events: auto; }
.mmsearch { width: min(280px, 100%); box-sizing: border-box; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--s2); color: var(--text); font: 400 13px/18px var(--sans); }
.mmlegend { display: flex; flex-wrap: wrap; gap: 6px; }
.mmleg { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--s2); color: var(--dim); font: 400 12px/16px var(--mono); cursor: pointer; }
.mmleg[aria-pressed="true"] { background: var(--s3); color: var(--text); border-color: var(--line-2); }
.mmleg i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.mmskip { margin: 0; color: var(--faint); font-size: 12px; }
.mmcard { position: absolute; left: 10px; right: 10px; bottom: 10px; max-width: 360px; display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r-3); background: var(--s2); }
.mmcard[hidden] { display: none; }
.mmmeta { color: var(--dim); font: 400 12px/16px var(--mono); overflow-wrap: anywhere; }
.mmopen { justify-self: start; margin-top: 4px; padding: 5px 14px; border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--s3); color: var(--text); font: 600 13px/18px var(--sans); cursor: pointer; }
.mmopen:disabled { opacity: .5; cursor: not-allowed; }

/* Phone: the top bar is already full (it overflowed sideways with the Memory button), so there the
   drawer carries the Memory entry, like Collective (style.css). */
body:not(.breed) #memoryBtn { display: none; }
body.breed #memEntry { display: none; }

/* Phone: the legend is one row you scroll sideways, so it leaves the canvas free. */
body:not(.breed) .mmlegend { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
body:not(.breed) .mmleg { flex: none; }
body:not(.breed) .mmbar { min-width: 0; }
