.memory-list {
  display: grid;
  flex: 1 1 auto;
  gap: 0.85rem;
  align-content: start;
}

.memory-entry {
  width: 100%;
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--panel-alt);
  color: var(--text);
  text-align: left;
  border: 1px solid var(--border-subtle);
}

.memory-entry:hover,
.memory-entry:focus-visible {
  background: var(--surface-hover);
}

.memory-label {
  font-size: 0.86rem;
  color: var(--text-faint);
  margin-bottom: 0.3rem;
}

.memory-value {
  font-size: 1.15rem;
  overflow-wrap: anywhere;
}

.memory-entry-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.75rem;
}

.memory-surface {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: right;
}

.memory-entry .inline-toolbar {
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  padding: 0;
  gap: 0.3rem;
}

.memory-entry .memory-action {
  border-radius: 4px;
  background: var(--surface-active);
  color: var(--text-soft);
}

.app-shell.layout-desktop .memory-list {
  gap: 0.35rem;
}

.app-shell.layout-desktop .memory-entry {
  padding: 0.55rem 0.5rem 0.45rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
}

.app-shell.layout-desktop .memory-entry:hover,
.app-shell.layout-desktop .memory-entry:focus-within {
  background: var(--surface-hover);
}

.app-shell.layout-desktop .memory-entry-row {
  align-items: stretch;
  gap: 0.45rem;
}

.app-shell.layout-desktop .memory-value {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.15;
}

.app-shell.layout-desktop .memory-entry .inline-toolbar {
  align-self: flex-end;
  opacity: 0;
  pointer-events: none;
  transform: translateY(2px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.app-shell.layout-desktop .memory-entry:hover .inline-toolbar,
.app-shell.layout-desktop .memory-entry:focus-within .inline-toolbar {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.app-shell.layout-desktop .memory-entry .memory-action {
  min-height: 26px;
  padding: 0.2rem 0.45rem;
  background: var(--surface-active);
  color: var(--text);
}

.app-shell.layout-desktop .memory-entry .memory-action:hover,
.app-shell.layout-desktop .memory-entry .memory-action:focus-visible {
  background: var(--surface-hover);
}

.app-shell.layout-desktop .memory-entry .memory-surface {
  align-self: stretch;
  width: 100%;
}
