/* Memory page (graph + note panel) and Verwaltung > Zugangsdaten. */

.page-memory {
  max-width: none;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 24px 28px 24px;
}

.mem-head {
  flex: none;
  margin-bottom: 14px;
}

.mem-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mem-tools .search-field {
  flex: 0 1 260px;
}

.mem-chips {
  flex: none;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 12px;
  scrollbar-width: thin;
}

.mem-chips:empty {
  display: none;
}

.mem-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  height: 30px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  transition: opacity 0.2s, background 0.2s, border-color 0.2s;
}

.mem-chip:hover {
  background: var(--surface-2);
}

.mem-chip small {
  color: var(--text-3);
  font-weight: 600;
}

.mem-chip.off {
  opacity: 0.45;
  text-decoration: line-through;
}

.mem-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}

/* stage: graph on the left, note panel slides in on the right */
.mem-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 14px;
}

.mem-graph {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 20% 15%, var(--glow-a), transparent 55%),
    radial-gradient(circle at 85% 90%, var(--glow-b), transparent 55%),
    var(--surface);
}

.mem-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
  display: block;
}

.mem-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.mem-overlay[hidden] {
  display: none;
}

.mem-state {
  display: grid;
  gap: 12px;
  justify-items: center;
  pointer-events: auto;
}

.mem-zoom {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--glass);
  backdrop-filter: blur(10px);
}

.mem-hint {
  position: absolute;
  left: 12px;
  bottom: 12px;
  max-width: calc(100% - 90px);
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--glass);
  backdrop-filter: blur(10px);
  color: var(--text-2);
  font-size: 0.8rem;
}

.mem-skeleton {
  position: absolute;
  inset: 0;
}

.mem-skel-dot {
  position: absolute;
  border-radius: 50%;
  background: var(--surface-3);
  animation: pulse 1.4s ease-in-out infinite;
}

/* note panel */
.note-panel {
  flex: none;
  width: 0;
  min-width: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  border: 0 solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  transition: width 0.32s var(--ease), opacity 0.25s ease, visibility 0s linear 0.32s, border-width 0s linear 0.32s;
}

.note-panel.open {
  width: min(460px, 42%);
  opacity: 1;
  visibility: visible;
  border-width: 1px;
  transition: width 0.32s var(--ease), opacity 0.25s ease, visibility 0s, border-width 0s;
}

.note-panel-bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 10px 18px;
  border-bottom: 1px solid var(--border);
}

.note-panel-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
}

.note-body {
  flex: 1;
  min-height: 0;
  min-width: 340px;
  overflow: auto;
  padding: 18px 20px 28px;
}

.note-title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.note-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.note-meta .path-chip {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tag-chip {
  padding: 2px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
}

.note-fm {
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}

.note-fm summary {
  padding: 8px 12px;
  cursor: pointer;
  color: var(--text-2);
  font-size: 0.82rem;
  font-weight: 600;
}

.note-fm pre {
  margin: 0;
  padding: 0 12px 12px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text-2);
}

.note-md {
  margin: 4px 0 22px;
  animation: fade-in 0.25s ease;
}

.note-md .wikilink {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed color-mix(in srgb, var(--accent) 60%, transparent);
  cursor: pointer;
}

.note-md .wikilink:hover {
  border-bottom-style: solid;
}

.note-md .wikilink.missing {
  color: var(--text-3);
  border-bottom-color: var(--border-strong);
  cursor: default;
}

.note-md table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.note-md th,
.note-md td {
  padding: 5px 10px;
  border: 1px solid var(--border);
}

.note-links {
  margin-top: 18px;
}

.note-links h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-3);
}

.note-links ul {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.note-link-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 0.88rem;
  transition: background 0.15s;
}

.note-link-btn:hover {
  background: var(--surface-2);
}

.note-link-btn .icon {
  flex: none;
  color: var(--text-3);
}

.note-link-btn span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-link-btn small {
  margin-left: auto;
  flex: none;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .page-memory {
    padding: 18px 16px 16px;
  }

  .note-panel,
  .note-panel.open {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 5;
    width: auto;
    height: 0;
    box-shadow: var(--shadow);
    transition: height 0.32s var(--ease), opacity 0.25s ease, visibility 0s linear 0.32s, border-width 0s linear 0.32s;
  }

  .note-panel.open {
    height: 72%;
    transition: height 0.32s var(--ease), opacity 0.25s ease, visibility 0s, border-width 0s;
  }

  .note-body {
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .note-panel,
  .note-panel.open {
    transition: none;
  }
}

/* ---------------------------------------------------------- Zugangsdaten */

.cred-note {
  margin-bottom: 14px;
}

.cred-row {
  flex-wrap: wrap;
}

.cred-row .trow-main {
  flex: 1 1 220px;
}

.cred-url {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cred-user {
  display: grid;
  gap: 2px;
  min-width: 130px;
}

.cred-value {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.cred-pw {
  letter-spacing: 0.04em;
}

.cred-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.cred-pw-field {
  position: relative;
}

.cred-pw-field .input {
  padding-right: 46px;
}

.cred-pw-field .icon-btn {
  position: absolute;
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
}
